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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    68 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    151 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X