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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X