Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM strategy delayed by 1 bar if executed within a bar

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

    ATM strategy delayed by 1 bar if executed within a bar

    I am working with an ATM strategy. It uses a 1 minute bar timeframe.

    The issue I'm running into may likely be due to this statement provided by the document for GetAtmStrategyMarketPosition():
    ​​​​​​
    Changes to positions will not be reflected till at least the next OnBarUpdate() event after an order fill.
    I'm looking for confirmation and for a work-around.

    An example of order execution:

    11:32:59 OnBarClose: Entry conditionals are met and the ATM strategy executes it's entry
    11:33:52 The ATM strategy take profit target executes
    11:33:59 OnBarClose: Entry conditionals are met but the ATM strategy does not execute. Almost as if GetAtmStrategyMarketPosition() didn't report it as executed
    11:34:59 OnBarClose: Entry conditionals are met and the ATM strategy executes it's entry

    Ideally, the trade would have closed during that entry bar and on the close of that bar, the entry is still met and a new ATM is entered being that the first one closed.
    If it didn't take an additional bar to enter, a larger profit could have been made - or more importantly a smaller loss.

    If the GetAtmStrategyMarketPosition() is the problem, is there a way to get around this delay? I want to only enter a new ATM if there are no working orders.

    Thanks.
    Last edited by brettcomardelle93; 08-18-2020, 12:04 PM.

    #2
    Welcome to the forums brettcomardelle93!

    Please note that ATM strategies are initiated from NinjaScript strategies. We can use the ATM strategy methods to "peek/poke" the ATM strategy, but the ATM strategy is actually run as a separate strategy. Thus, it may take a bar or a few ticks for the ATM strategy methods to register.

    We may suggest running the strategy with Calculate.OnEachTick or Calculate.OnPriceChange, running the strategy on a smaller time frame, or adding another data series to the strategy so the logic is processed intrabar, or more frequently.

    More information on working with Multi Time Frame scripts can be found here - https://ninjatrader.com/support/help...nstruments.htm

    We look forward to assisting.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Working...
    X