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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    53 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X