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

Initial number of bars on chart prior to loading

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

  • NinjaTrader_Jesse
    replied
    Hello bltdavid,

    When TickReplay is enabled the bars are being built from tickreplay data so the count is not known ahead of time when used from OnBarUpdate.

    Leave a comment:


  • bltdavid
    replied
    Originally posted by NinjaTrader_Jesse View Post
    As long as TickReplay is not being used you could use the Count property on any series to know how many points it has. [url]https://ninjatrader.com/support/helpGuides
    Hi Jesse.

    So, uh, what does TickReplay have to do with many 'points' in a Series?

    I mean, that sounds counterintuitive -- if you want to know how many historical
    bars exist in the primary data series on the chart, how does that number change
    when TickReplay is used?

    The link you provided does not mention a relationship between Count and TickReplay.

    Leave a comment:


  • gbrad
    replied
    Hi Jesse,

    Yes, that's what I needed. I tested it and it works fine.

    Thank you very much.

    gbrad

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello gbrad,

    What you are asking is what I provided in post 2, please try printing the Count property. You can do that on bar 0 or if you wanted in State.DataLoaded.

    Please let me know if I may be of further assistance.

    Leave a comment:


  • gbrad
    replied
    Hi Jesse,

    bltdavid gets to my point. I would like to know how many bars would initially get loaded prior to hitting bar 0 in OnBarUpdate. Is that possible?

    Note, I don't really need the exact number, just something near that number.

    In my case, I'm not using TickReplay, but that's good to know.

    Thanks,
    gbrad

    Leave a comment:


  • bltdavid
    replied
    Can't Count be examined during State.DataLoaded?

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello gbrad,

    As long as TickReplay is not being used you could use the Count property on any series to know how many points it has. https://ninjatrader.com/support/help...ries_count.htm

    Code:
    Print(Count);
    If you are going to use that for any index purposes then you would need to subtract depending on the Calculate setting, with OnBarClose you would be looking at Count - 2 to get the last bar, OnEachTick would be Count - 1.

    I look forward to being of further assistance.

    Leave a comment:


  • gbrad
    started a topic Initial number of bars on chart prior to loading

    Initial number of bars on chart prior to loading

    Hi,

    Is there any way within Ninja Script to find out how may bars will be loaded initially on a chart prior to the chart being loaded?

    Thanks,
    gbard

Latest Posts

Collapse

Topics Statistics Last Post
Started by ezrollin, Today, 10:40 AM
5 responses
7 views
0 likes
Last Post NinjaTrader_Jesse  
Started by sidlercom80, Today, 10:20 AM
2 responses
6 views
0 likes
Last Post sidlercom80  
Started by TraderElegante, Today, 09:53 AM
2 responses
16 views
0 likes
Last Post TraderElegante  
Started by Kreyenhagen, Today, 09:03 AM
1 response
7 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by trader3000a, Today, 04:23 AM
1 response
10 views
0 likes
Last Post NinjaTrader_Jesse  
Working...
X