Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NTFilled not returning correct position

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NTFilled not returning correct position

    When the NTFilled function is called the only input is the Order ID. When the order is created, the account number is associated with the Order ID, so I assume that when the same Order ID is called up by the NTFilled function, it will get the correct information regardless of other accounts being traded on the same platform, as long as there is no duplication of the Order ID itself.

    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.

    Code:
    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;
    Code:
    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;
    Attached Files
    Last edited by Atomic; 11-06-2012, 04:01 PM. Reason: more info

    #2
    Atomic,

    Could we get your log/trace from the day that this order was placed?

    These are located in My Documents / NinjaTrader 7 / trace and My Documents / NinjaTrader 7 / log folders.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_AdamP View Post
      Atomic,

      Could we get your log/trace from the day that this order was placed?

      These are located in My Documents / NinjaTrader 7 / trace and My Documents / NinjaTrader 7 / log folders.
      Can I email it to you?

      Comment


        #4
        Atomic,

        Yes of course. Please send it to support at ninjatrader dot com with ATTN : Adam in the message body.
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, Today, 06:40 PM
        0 responses
        9 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        7 views
        0 likes
        Last Post maybeimnotrader  
        Started by quantismo, Today, 05:13 PM
        0 responses
        7 views
        0 likes
        Last Post quantismo  
        Started by AttiM, 02-14-2024, 05:20 PM
        8 responses
        168 views
        0 likes
        Last Post jeronymite  
        Started by cre8able, Today, 04:22 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X