Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

TraceOrder confusion

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

    TraceOrder confusion

    What is happening here with respect to the time the order is placed?

    code:
    if (entryOrder == null && (Close[0] > Open[0]))
    {
    entryOrder = EnterLong("mar****rder");
    }

    TraceOrder output:
    3/2/1993 12:00:00 AM Entered internal PlaceOrder() method at 3/2/1993 12:00:00 AM: Action=Buy OrderType=Market Quantity=100 LimitPrice=0 StopPrice=0 SignalName='mar****rder' FromEntrySignal=''

    as well, please see attached image - the date of that market order according to the data box is 3/3/1993

    the way I understand this, the entry condition is met on the close of 3/2/1993. according to the image, the buy order is placed on the open of 3/3/1993. according to the TraceOrder output, the market order is placed on 3/2/1993 at 12:00AM, which is actually BEFORE the entry condition was even met. what is going on here?? i am very confused.

    (i am using yahoo for ohlc daily bars)

    thanks kindly for any help,

    ben
    Attached Files

    #2
    This is expected. You are in a historical/backtest environment and as such all your bars are being processed at the end of each bar. On 3/2 you got the signal to place in the trade. Since 3/2 is already over, the next tradeable location is 3/3 and so that is why you see the order go in on 3/3.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by benmarkal, Yesterday, 12:52 PM
    3 responses
    22 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by helpwanted, Today, 03:06 AM
    1 response
    16 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    11 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    6 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    244 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Working...
    X