Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time series references

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

    Time series references

    I'm trying to figure out if I am actually referencing the 3rd bar series I added in Initialize() in my entry conditions

    if (BarsInProgress==0) {
    if (
    (Position.MarketPosition == MarketPosition.Flat)
    && (BarsSinceExit(0,"",0) == -1 || BarsSinceExit(0,"",0) > 0)
    && (Close[2][0]>Open[2][0])
    )
    {
    EnterLong(0, quantity,"LockedLong");
    EnterLong(0, quantity,"Long");
    }
    }

    The part in question is (Close[2][0]>Open[2][0])

    So I understand from the last post I made http://www.ninjatrader.com/support/f...ad.php?t=63108 that I have to use BarsInProgress, but what if I want to enter on the 1st bar series but my entry conditions include other bar series? How can I make it check a, for example, 10 min time series as well as the primary series

    #2
    Hello albazzaztariq,

    Thank you for your note.

    You are properly referencing the third bar series for the condition and then entering on the primary bar series. Please visit the following link for information on multiple time frames and instruments in your code: http://www.ninjatrader.com/support/h...nstruments.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      (Close[2][0]>Open[2][0])
      should be:
      Code:
      (Close[B][COLOR=Red]s[/COLOR][/B][2][0]>Open[B][COLOR=Red]s[/COLOR][/B][2][0])

      Comment


        #4
        I accidentally put this in writing this snippet up solely for this thread. Thank you though

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        52 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 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