Apologies if this has been asked before but I have searched the forums and couldn’t find how to do this. I am still a beginner at this but really enjoying it.
I am trying to code a trailing stop loss which is a multiple of ATR from the last high since being in the market (i.e. Tradeprice). Once the close goes through this level then sell at next open.
I thought using the Barindex-tradeindex like in code below was correct but sometimes it just sells the next day from purchase even if the move was in a profitable position.
The ‘General Trading Discussions’ forum is for….. well general trading discussions. Your question is automatic trading strategy coding related and so should be in the ProOrder forum. I have moved it – please try to post in the most relevant forum with future posts.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.