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 rocketman7, Today, 02:12 AM
    0 responses
    2 views
    0 likes
    Last Post rocketman7  
    Started by dustydbayer, Today, 01:59 AM
    0 responses
    1 view
    0 likes
    Last Post dustydbayer  
    Started by inanazsocial, Today, 01:15 AM
    0 responses
    3 views
    0 likes
    Last Post inanazsocial  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    22 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Working...
    X