• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Revan, Yesterday, 11:53 PM
    4 responses
    21 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by Vincere, Today, 03:32 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by hir04068, Today, 04:26 AM
    0 responses
    5 views
    0 likes
    Last Post hir04068  
    Started by Thomas79, Today, 03:22 AM
    0 responses
    3 views
    0 likes
    Last Post Thomas79  
    Started by pjsmith, Today, 12:50 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Working...
    X