Below are the logs for the two platforms and the section of code that produced the bad order on one computer (the one doing actual trades). Both computers running the same code. The sim and actual accounts were both short as evidenced by the trade logs, so the additional sell order should not have been sent on the computer doing live trades, but it was, so we ended up being short twice the desired number of contracts.
if LBOC then begin if 86400*fracportion(computerdatetime) - LastTime >= UpdateIntervalTime or barstatus(1) = 2 then begin NTFills = //+NTFilled(ABMomLE) +NTFilled(BSLng1) +NTFilled(BSLng2) +NTFilled(BSLng3) +NTFilled(BSLng4) +NTFilled(BSLng5) +NTFilled(BSSX) +NTFilled(LatePMSX) //-NTFilled(ABMomSE) -NTFilled(BSSht1) -NTFilled(BSSht2) -NTFilled(BSSht3) -NTFilled(BSSht4) -NTFilled(BSSht5) -NTFilled(BSLX) -NTFilled(LatePMLX); //NTOSABMomLE = NTOrderStatus(ABMomLE); //NTOSABMomSE = NTOrderStatus(ABMomSE); NTOSBSLng1 = NTOrderStatus(BSLng1); NTOSBSLng2 = NTOrderStatus(BSLng2); NTOSBSLng3 = NTOrderStatus(BSLng3); NTOSBSLng4 = NTOrderStatus(BSLng4); NTOSBSLng5 = NTOrderStatus(BSLng5); NTOSBSSht1 = NTOrderStatus(BSSht1); NTOSBSSht2 = NTOrderStatus(BSSht2); NTOSBSSht3 = NTOrderStatus(BSSht3); NTOSBSSht4 = NTOrderStatus(BSSht4); NTOSBSSht5 = NTOrderStatus(BSSht5); NTOSBSLX = NTOrderStatus(BSLX); NTOSBSSX = NTOrderStatus(BSSX); NTOSLatePMLX = NTOrderStatus(LatePMLX); NTOSLatePMSX = NTOrderStatus(LatePMSX); NTOrStat = NTOrderStatus(NTOrderID); if NTFills <> PrevNTFills then LastEntryTime = 86400*fracportion(computerdatetime); PrevNTFills = NTFills; //NTFillsText = numtostr(NTFills,0); if TT then value1 = text_setstring(NTFillsTextID,numtostr(NTFills,0)+"("+numtostr(MP,0)+")") else value1 = text_setstring(NTFillsTextID,"OFF"); value1 = text_setlocation(NTFillsTextID,date,minutestotime(timetominutes(time)+9),open); LastTime = 86400*fracportion(computerdatetime); end; end;
if time >= 1430 and time < 1500 and TStopS[1] and high > close[1] and close[1] >= avgprice[1] and TT and suri.istradingday(date) = 1 and DayNum > 125 //and MP = 1 and NTFills > 0 and LateXitSent = false then begin if NTOrderStatus(NTOrderID) = "Working" or NTOrderStatus(NTORderID) = "PartFilled" then value1 = NTCancel(NTOrderID); value1 = NTCommand("PLACE",NTAcct,"Sell",maxlist(NTContracts,maxlist(0,NTFills)),"market",0,0,"Day","",LatePMLX,"",""); fileappend(NTLogFile,formattime("hh:mm:ss tt",computerdatetime)+S5+"SellTC"+S5+numtostr(maxlist(NTContracts,maxlist(0,NTFills)),0)+" @Market"+S5+LatePMLX+newline); LateXitSent = true; end;
Comment