Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

(FirstTickOfBar) in an Indicator development .

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

    (FirstTickOfBar) in an Indicator development .

    Dear Sir or Madam,
    Thank you for giving time to consider my request.
    While I was trying to develop an indicator plotting arrows using some other indicators, due to the used indicators are working on switching based first tick of bar, I tried to plot arrow by using the (FirstTickOfBar) command:
    protected override void OnBarUpdate()
    {
    if (FirstTickOfBar)
    {
    if (condition) // Do: Plot Arrows, dot ....
    }
    }
    No problem till now, as the arrows are plotted & the conditions are working fine. But.
    Somehow I found that this command is active and can be used only in a case of strategy development more, it cannot be used in an indicator development case. and the arrows show at the close of the bar.
    and I was wondering if I did something wrong using this command in an indicator development? if Yes, is there any alternative method to call a condition from the First Tick of Bar in case of indicator development.
    I hope if you can clarify me the subject on using (FirstTickOfBar) in an indicator development situation
    Thank you.

    #2
    Hello Yassine.Chetouani,

    Thanks for your post.

    The use of FirstTickOfBar depends on the setting of CalculateOnBarClose.

    If CalculateOnBarClose = true, then each bar will only generate one tick which will be at the end of the bar thus FirstTickOfBar will be true also once per bar at the end of the bar.

    If CalculateOnBarClose = false, then FirstTickOfBar will be true once on the first tick of the bar.

    This would be true for both strategies and indicators.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    153 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    89 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    133 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    128 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X