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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    56 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X