Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

About the Time frame

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

    About the Time frame

    Hello,

    I am new. When the first condition found from 15 minutes and then the second condition found from 5 minutes.
    I would like to trade in 5 minutes and know the script.

    Thank you and excuse my English.

    Code:
    For example:
    Condition 1(15M) ->Condition 2(5M) -> Entry
    
      // Entry condition 1
       if (CrossAbove(RSI(14, 3), 30, 1)) 
       
         // Entry condition 2
        if (Close(0)<(EMA(20))      
             EnterLong("??");

    #2
    Hello delta234,

    You will need to add a secondary bar series to your script.

    For example if you run this on a 5 minute chart, add a 15 minute series to your script. Then use that BarsArray object to supply the 15 minute bars to the indicator call.

    In Initialize():
    Add(PeriodType.Minute, 15);

    In OnBarUpdate():
    if (BarsInProgress == 0 && CrossAbove(RSI(BarsArray[0], 14, 3), 30, 1) && Closes[1][0] < EMA(BarsArray[1], 20)[0])
    {
    // execute code
    }

    Below are a few links to the help guide on working with multiple time frames.

    Multi-Time Frame & Instruments - http://ninjatrader.com/support/helpG...nstruments.htm

    Add - http://ninjatrader.com/support/helpGuides/nt7/add3.htm

    BarsArray - http://ninjatrader.com/support/helpG.../barsarray.htm

    BarsInProgress - http://ninjatrader.com/support/helpG...inprogress.htm

    Closes - http://ninjatrader.com/support/helpG...nt7/closes.htm
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    630 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    566 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X