Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Few questions

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

    Few questions

    Hi,

    1. How to check how many days loaded before ChartBars.ToIndex? Using count based on Bars.IsFirstBarOfSessionByIndex? Is there more elegant way to do so?

    2.How place indicator on chart (same as input series) within a code? So the indicator will not create a new panel when I load it.

    3. Let's say I use 1000 tick charts. How to get accurate price at 9:00 AM? Is it possible w/o using another data series(minute charts)?

    4. Would it be it possible to reload the indicator if some error happened (within the code)?

    #2
    Hello Leeroy_Jenkins,

    Thanks for your post.

    1) If you are looking at calendar days you could check to see Time.GetValueAt(barIndex).DayOfWeek != Time.GetValueAt(barIndex-1).DayOfWeek Otherwise looking for session the way you are works as well.

    2) An indicator panel is created by the bool IsOverLay as set in state.SetDefaults: https://ninjatrader.com/support/help...?isoverlay.htm

    3) For live data, if you run your code with Calculate.OnEachTick or Calculate.OnPriceChange you would likely be able to get the time at 9:00 AM. For Historical data you would need to enable TickReplay. Otherwise an added data series would be the answer.

    4) You can try reloading but if the conditions that created the error still exist, then it would error again. Best to debug and resolve the error condition.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    649 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    576 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X