Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddChartIndicator()

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

    AddChartIndicator()

    I have added an indicator to my strategy with AddChartIndicator during state.configure.

    I would like my strategy to calculate on bar close and my indicator to calculate on price change. Is it possible to do this?

    Thanks,
    eleven

    #2
    Hello,

    Thank you for the post.

    In this case I don't believe this would be possible. Because the Strategy controls the indicators Calculate setting, it would also be on Bar close.

    Potentially you could use OnEachTick instead. In the strategy you could filter logic based on the IsFirstTickOfBar which could essentially represent the bar close, and in the indicator you could compare the Close price to a stored variable to check if the price had changed to complete logic. In theory this could potentially work, but depending on the logic this could also cause problems. This would also assume the indicator gets called for each tick, if it was called from the IsFirstTickOfBar logic it would only be called sometimes which may not be when the price changes.

    Outside of creating your own logic to handle the situation using OnEachTick, I could not see a way this would be possible.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    55 views
    0 likes
    Last Post CarlTrading  
    Working...
    X