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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        60 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X