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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    161 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    309 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    245 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    349 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    179 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X