I'm trying to create a dynamic stop for my trading system that:
1. Sets a stop loss initially when a trade is entered, with the stop distance based on the ATR indicator. My system allows up to 4 entries in the same direction (4 consecutive individual trades, either all long or all short).
2. Moves the stop loss closer to breakeven once a certain open profit is achieved
3. Moves the stop to breakeven plus a tick or two once a 2nd profit target is achieved.
I've got step 1 working so far, using SetStopLoss under the OnOrderUpdate method. I'm about to start on steps 2 and 3 and I figure the best/easiest way to approach it is to continue using a SetStopLoss approach, combined with Position.AvgPrice and the current price to calculate the profit targets. Something like this:
http://www.ninjatrader.com/support/forum/showthread.php?t=57666&highlight=dynamic+stops
My question to the forum is:
I allow my system to take up to 4 entries in each direction. I want the strategy to handle the dynamic stop for each entry individually. When I call on Position.AvgPrice in order to calculate the profit of each trade, will it give me the entry price for each entry or will it give the average price for the overall position?
If Position.AvgPrice can't be used for individual entries but only for aggregate positions, then I would assume this is not the way to manage and modify stop orders for what I'm trying to accomplish?
Comment