Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM Strategy using prior OHLC

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

    ATM Strategy using prior OHLC

    Hello,

    I don't want to ask a ridiculously long question but I am having a little trouble with the Strategy Analyzer. I'll make the question very simple and I think if I can get an answer I could extrapolate that into what I am trying to do.
    Here's my simple example:

    How would I set the conditions so that if the price of ES for the last 10 3minute bars (30 minutes) was above the prior day high, if it touches the prior high limit buy 1 ES contract.

    If the prior 10 3 minute bars (30 minutes) was below the prior day high and the price touches the prior high limit sell 1 ES contract.

    I know this isn't a strategy but if I can get this working it will answer a half dozen or so questions I have.

    Thank You,

    J

    #2
    Hello jtrader,

    Welcome to the NinjaTrader forums!

    You can use built in function MAX() and MIN() to capture the highest and lowest values over the specified number of bars. The statement below evaluates whether the highest value over the last 3 bars is greater than or equal to the prior day high.

    if (MAX(High, 3)[0] >= PriorDayOHLC().High[0])
    EnterLong();
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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