My ATM strategy:
Target 1:
- Stop Loss: 16 ticks, Profit 16 ticks
- Stop limit for stop loss enabled
- Stop Loss: 3 ticks
- Profit Trigger: 4 ticks
- Frequency: 1 tick
atmStrategyId = GetAtmStrategyUniqueId(); orderId = GetAtmStrategyUniqueId(); // used for getting the order status double currentBid = GetCurrentBid(); Print("Current Bid " + currentBid); double prevLow = Low[1]; Print("Current Low " + prevLow); AtmStrategyCreate(OrderAction.Buy, OrderType.Limit, currentBid, 0, TimeInForce.Day, orderId, "Engulfing", atmStrategyId, (atmCallbackErrorCode, atmCallBackId) => { if (atmCallbackErrorCode == ErrorCode.NoError && atmCallBackId == atmStrategyId) { isAtmStrategyCreated = true; inPosition = true; Print(Time[0].ToString() + " Entered a long position.");// Stop was set to: " + Low[1].ToString()); Print("ATMStrategyId " + atmStrategyId); if(isAtmStrategyCreated) { Print("ATM create. Adjusting stop to high."); AtmStrategyChangeStopTarget(0, prevLow, "Stop1", atmStrategyId); // will this be limit or market?? } } }); Print("Long should have been created.");
It isn't doing this. It doesn't update the stop loss.
The Print() statement just above it executes.
Comment