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 usazencort, Today, 01:16 AM
    0 responses
    1 view
    0 likes
    Last Post usazencort  
    Started by kaywai, 09-01-2023, 08:44 PM
    5 responses
    603 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    6 responses
    23 views
    0 likes
    Last Post xiinteractive  
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    22 views
    0 likes
    Last Post Pattontje  
    Started by flybuzz, 04-21-2024, 04:07 PM
    17 responses
    230 views
    0 likes
    Last Post TradingLoss  
    Working...
    X