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

(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.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Radano, 06-10-2021, 01:40 AM
    20 responses
    616 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by Mizzouman1, Today, 07:35 AM
    0 responses
    5 views
    0 likes
    Last Post Mizzouman1  
    Started by i019945nj, 12-14-2023, 06:41 AM
    6 responses
    66 views
    0 likes
    Last Post i019945nj  
    Started by aa731, Today, 02:54 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by BarzTrading, Today, 07:25 AM
    0 responses
    3 views
    0 likes
    Last Post BarzTrading  
    Working...
    X