Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 lightsun47, Today, 03:51 PM
    0 responses
    5 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    10 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    46 views
    0 likes
    Last Post futtrader  
    Started by Option Whisperer, Today, 09:55 AM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by port119, Today, 02:43 PM
    0 responses
    10 views
    0 likes
    Last Post port119
    by port119
     
    Working...
    X