Sorry to beat this dead horse but this ATM thing is killing me - LOL ! I keep getting multiple entries in the same direction and i cant figure out why. i'm using a variable for order ID and a variable for Strategy ID and using a test on the string lengths to make sure those are null strings with length 0 (this is from an example script on the forum). once there is an order filled the orderID string is not empty so I'm not exactly sure why i keep getting multiple entries here (btw, how do i insert code in the message)
if ((orderIdL.Length == 0) && (atmStrategyIdL.Length == 0) && longSignal && GetAtmStrategyMarketPosition(atmStrategyIdS)<0)
{
// if short then exit and reverse
if (atmStrategyIdS.Length>0)
{
AtmStrategyClose(atmStrategyIdS);
orderIdS = string.Empty;
atmStrategyIdS = string.Empty;
}
atmStrategyIdL = GetAtmStrategyUniqueId();
orderIdL = GetAtmStrategyUniqueId();
orderBarL = CurrentBar;
AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Market,0,0, TimeInForce.Day, orderIdL, "1BWTrades", atmStrategyIdL);
} is the example of what I'm doing


Comment