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 cre8able, Today, 01:16 PM
    2 responses
    9 views
    0 likes
    Last Post cre8able  
    Started by chbruno, 04-24-2024, 04:10 PM
    3 responses
    48 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by samish18, Today, 01:01 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by WHICKED, Today, 12:56 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by WHICKED, Today, 12:45 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X