I am attempting to use the AtmStrategyChangeStopTarget method within a strategy to set custom stops and targets. However, when viewing the orders with chart trader, the stop and target always set by the ATM template only.
The following is the code block I'm using to set them:
if (atmStrategyId.Length > 0 ) { if(GetAtmStrategyMarketPosition(atmStrategyId) == Cbi.MarketPosition.Flat) { Print("Flat"); atmStrategyId = string.Empty; } else { if( EnableFractalStop ) { double avgPrice = GetAtmStrategyPositionAveragePrice(atmStrategyId); stopTicks = getStopTicks(false, avgPrice); targetTicks = (int)((double)stopTicks * RewardRatio); stopPrice = avgPrice + (TickSize * (double)stopTicks); targetPrice = avgPrice - (TickSize * (double)targetTicks); AtmStrategyChangeStopTarget(0, stopPrice, "Stop1", atmStrategyId); AtmStrategyChangeStopTarget(targetPrice, 0, "Target1", atmStrategyId); } } }
Comment