Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multitameframe - getting bars

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

    Multitameframe - getting bars

    Hi all there,
    I dont know how to go on
    I have main bar Range 6 and in Initialize method I added
    Add(Instrument.FullName, PeriodType.Tick, 1, MarketDataType.Last);
    CalculateOnBarClose is false.

    In OnBarUpdate() I have something like:
    if (BarsInProgress==0) {
    Print("******************************************* **********");
    Print("RANGE: "+CurrentBars[0]); //main bars
    Print("******************************************* **********");
    }
    if (BarsInProgress==1) {
    Print("TICK: "+CurrentBars[1]); //tciks bars
    }
    }

    Result is:
    TICK: 0
    TICK: 1
    TICK: 2
    TICK: 3
    .
    .
    .
    TICK: 100 (for example)
    ********************************
    RANGE: 0
    ********************************
    TICK: 101
    .
    .
    .
    TICK: X
    ********************************
    RANGE: 1
    ********************************
    ETC.

    So I know from the list that to the RANGE bar index 0 "belongs" 100 TICK bars. To the RANGE bar 1 belongs X-101 prevoius bars etc.
    BUT - I dont want to save these info, if it is not necessary, and when I click(for example) on any main bar on chart and It has index let say 100, how can I get all prevoius tick bars belongs to this main bar ?? For example when I click bar index 0 I need to get (I mean go through) all 100 tick bars "belongs" to this main bar. Is it possible in any way ??

    Of couse I have my own onmousedown event where I need to process data.
    Thankyou very much for your help.
    Alex
    Last edited by Alexik30; 11-14-2013, 04:18 PM.

    #2
    Hello,

    Thanks for your post.

    There isn't a pre-made way to get this information. I recommend that you increment a variable on each in bars in progress 1 and on each bars in progress 0 save this to a dataseries or an array and then reset the variable.
    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
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X