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 DJ888, 04-16-2024, 06:09 PM
    4 responses
    12 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by terofs, Today, 04:18 PM
    0 responses
    8 views
    0 likes
    Last Post terofs
    by terofs
     
    Started by nandhumca, Today, 03:41 PM
    0 responses
    6 views
    0 likes
    Last Post nandhumca  
    Started by The_Sec, Today, 03:37 PM
    0 responses
    3 views
    0 likes
    Last Post The_Sec
    by The_Sec
     
    Started by GwFutures1988, Today, 02:48 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X