Strategy Code Example 2 - Time Limiting*** THIS IS JUST AN EXAMPLE OF STRATEGY TIME LIMITING CODE IMPLEMENTATION ***
This is a follow up to my example for risk management implementation here:
Code remains mostly unchanged, but now includes a time limiting implementation.
Relevant code blocks for the time factor are preceded with a comment stating:
*** FOCUS OF EXAMPLE ***
Cheers!
Example
Strategy Code Example - Risk Management*** THIS IS JUST AN EXAMPLE OF STRATEGY RISK MANAGEMENT CODE IMPLEMENTATION ***
For my own future reference, and for anyone else who needs it.
Pine script strategy code can be confusing and awkward, so I finally sat down and had a little think about it and put something together that actually works (i think...)
Code is commented where I felt might be necessary (pretty much everything..) and covers:
Take Profit
Stop Loss
Trailing Stop
Trailing Stop Offset
...and details how to handle the input values for these in a way that allows them to be disabled if set to 0, without breaking the strategy.exit functionality or requiring a silly amount of statement nesting.
Also shows how to use functions (or variables/series) to execute trade entries and exits.
Cheers!
Binary Option Arrows (example) [TheMightyChicken]An example of binary option arrows for candlestick patterns bearish and bullish harami. With results as colored background and an option to choose your expiration (one candle by default). It's just an example for those who has their own strategy and wants to make nice arrows in their chart. All you need to do is rewrite piece of script in lines 9:13 - feel free to ask me for any help, but I believe it's all clear.
Disclaimer: It's just an example how to script arrows for binary option and I am not responsible for any loss of money by using this particular strategy.
I wish happy and successful trading! ;)