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 itrader46, Today, 09:04 AM
    0 responses
    2 views
    0 likes
    Last Post itrader46  
    Started by timmbbo, Today, 08:59 AM
    0 responses
    1 view
    0 likes
    Last Post timmbbo
    by timmbbo
     
    Started by bmartz, 03-12-2024, 06:12 AM
    5 responses
    33 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by Aviram Y, Today, 05:29 AM
    4 responses
    14 views
    0 likes
    Last Post Aviram Y  
    Started by algospoke, 04-17-2024, 06:40 PM
    3 responses
    28 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X