I have a strategy that is entering the market using an ATM... which it seems to be doing OK... however, the ATM stop and trail settings are either being ignored or mis-calculated.
In the attached images, you can see the strategy has entered the market long. Although the markers are not appearing properly (something to do with replay and strategies), the entry is on the very last candle pictured.
In image 00: you can see it is using the correct strategy as indicated by the lightning bolt symbol showing ATM in use
in image 01: you can see the initial stop settings for the ATM
in image 02: you can see the trail settings for the ATM
For some reason, the trailing stop is being set only about 8 ticks away instead of the 30 specified.
When I use the ATM in the live market and manually place a trade, this ATM works as expected.
Previously when I've been back testing a strategy on market replay and using ATM hand off, it has worked.
For some reason it is handing off to ATM but ignoring the ATM settings in market replay. (I have not tested in live market yet)
Any help with this?
Thanks.
Note: here is the call to initiate the ATM
AtmStrategyCreate(
OrderAction.Buy
, OrderType.Market
, 0
, 0
, TimeInForce.Day
, orderId
, useATMName
, atmStrategyId
, (atmCallbackErrorCode, atmCallBackId) =>
{
//check that the atm strategy create did not result in error, and that the requested atm strategy matches the id in callback
if (atmCallbackErrorCode == ErrorCode.NoError
&& atmCallBackId == atmStrategyId)
{isAtmStrategyCreated = true;}
else
{Print("ATM ERROR MSG: " + atmCallbackErrorCode.ToString());}
}
);
Comment