Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Rapine Heihei, Today, 08:19 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    5 views
    0 likes
    Last Post Rapine Heihei  
    Started by f.saeidi, Today, 08:01 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 07:51 PM
    0 responses
    6 views
    0 likes
    Last Post Rapine Heihei  
    Started by frslvr, 04-11-2024, 07:26 AM
    5 responses
    98 views
    1 like
    Last Post caryc123  
    Working...
    X