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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X