TrailingStart and TrailingStep can either be different or equal, it’s up to you.
I think the problem is accumulating positions, as TRADEPRICE is an average af the entry price of all positions, so it will change as any single positions is added.
Sorry guys, Nicolas just reminded me that POSITIONPRICE is the average price of all open positions, while TRADEPRICE is the last price traded. This will not affect the above code, though.
2 users thanked author for this post.