Hi all,
I would like to code a Stop Loss based upon the level at which I opened a trade. I do not want it to trail the price, I just want it to stick at the point at which the trade opened. I would open a trade on the open price of NextBar. How do I then, in successive bars hold that open value as a stop loss ? The only examples I have seen are where the stoploss is modified for each bar, and is thus a local variable. In my thinking I cannot see that I can set the open trade level as a global variable or a local variable. Depending on when/if the stop loss is taken out, the code would have to hold that "trade open" stoploss for different time periods. Do you see my dilemma ?
Thanks in advance for you help folks.
Happy Thanksgiving to all !
Neil.
I would like to code a Stop Loss based upon the level at which I opened a trade. I do not want it to trail the price, I just want it to stick at the point at which the trade opened. I would open a trade on the open price of NextBar. How do I then, in successive bars hold that open value as a stop loss ? The only examples I have seen are where the stoploss is modified for each bar, and is thus a local variable. In my thinking I cannot see that I can set the open trade level as a global variable or a local variable. Depending on when/if the stop loss is taken out, the code would have to hold that "trade open" stoploss for different time periods. Do you see my dilemma ?
Thanks in advance for you help folks.
Happy Thanksgiving to all !
Neil.
Comment