NewPositionID=NumToStr(BarNumber,0)+Symbol;
if(LastBarOnChart and NTConnected(1)) then begin
if(NTOrderStatus(NewPositionID)="") then begin
Success=NTClosePosition(""); Success=NTBuyMarket(NewPositionID,NewPositionSize) ;
When the order is triggered, Tradestation gives an error complaining about possible reentrancy issues. Worse than that however, is that if you have multiple charts running the same strategy on different symbols, it will mix up the symbol when it places the order. It just went short EURUSD when it should have gone short GBPUSD, and cost me several thousand dollars. The print statements I output indicate a real reentrancy problem, Is there a fix for this?
Comment