Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simming Strategy doesnt work tick-by-tick, but bar-by-bar.

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

    Simming Strategy doesnt work tick-by-tick, but bar-by-bar.

    I'm simming a strategy. When I run it tick-by-tick, my EnterLongStop order doesn't make it. However, when I run the strategy bar-by-bar, then my EnterLongStop is executed. The code is:

    EnterLongStop(GetCurrentAsk() + TickSize);

    In image foo1.jpg, I'm running the sim tick-by-tick. You can see the trade isn't executed. The TraceOrder output is:

    4/1/2016 8:35:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=13 Currency=0 Simulated=False
    4/1/2016 8:35:00 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Ticks Value=16 Currency=0 Simulated=False
    4/1/2016 8:35:00 AM Entered internal PlaceOrder() method at 4/1/2016 8:35:00 AM: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2055.50 SignalName='' FromEntrySignal=''

    In image foo2.jpg, I'm running the sim bar-by-bar. This time, the trade is executed. The trace output is:

    4/1/2016 8:40:00 AM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=13 Currency=0 Simulated=False
    4/1/2016 8:40:00 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Ticks Value=16 Currency=0 Simulated=False
    4/1/2016 8:40:00 AM Entered internal PlaceOrder() method at 4/1/2016 8:40:00 AM: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=2055.75 SignalName='' FromEntrySignal=''

    Thoughts? Thanks,
    Attached Files

    #2
    Hello timmbbo,

    Thanks for opening the thread.

    EnterLongStop() will cancel if the order is not filled within that bar. It looks like the order is being placed on the 8:35:00 bar with a price at 2055.50 and that bar only reaches a price of 2055.25. The order would then be canceled on the next bar when the price ticks through. When calculating on bar close this price is submitted to the 8:40:00 bar where the price does tick through.

    Please try using the liveUntilCanceled argument in the Advanced Order Handling overload for EnterLongStop().

    From the help guide:
    Live Until Cancelled - The order will NOT expire at the end of a bar, but instead remain live until the CancelOrder() method is called or its time in force has been reached.
    Syntax:

    EnterLongStop(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double stopPrice, string signalName)

    EnterLongStop() - https://ninjatrader.com/support/help...erlongstop.htm
    Advanced Order Handling - https://ninjatrader.com/support/help...r_handling.htm

    Please let me know if this does not resolve your inquiry.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X