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 thanajo, 05-04-2021, 02:11 AM
    3 responses
    467 views
    0 likes
    Last Post tradingnasdaqprueba  
    Started by Christopher_R, Today, 12:29 AM
    0 responses
    10 views
    0 likes
    Last Post Christopher_R  
    Started by sidlercom80, 10-28-2023, 08:49 AM
    166 responses
    2,236 views
    0 likes
    Last Post sidlercom80  
    Started by thread, Yesterday, 11:58 PM
    0 responses
    4 views
    0 likes
    Last Post thread
    by thread
     
    Started by jclose, Yesterday, 09:37 PM
    0 responses
    9 views
    0 likes
    Last Post jclose
    by jclose
     
    Working...
    X