Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calling custom indicator from strategy (AddChartIndicator)

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

    Calling custom indicator from strategy (AddChartIndicator)

    I want to called the indicator from the strategy as it is related.

    I want to plot it, therefore I used AddChartIndicator(...).
    However, after I used this and go the chart there to continue to add the other indicator manually, then it give the error of

    unhandled exception object reference not set to an instance of an object

    Therefore, i am confused why would I getting this error.
    Attached Files

    #2
    Hello cincai,

    Thanks for your post.

    Just to check, you are saying that you add and enable the strategy to the chart and the strategy includes AddChartIndicator() with some indicator. At this point there is no error, is that correct? Does the indicator added with AddChartIndicator() display as expected?

    Sometime later you add some other indicator and at that point, the error is produced?

    As a test, can you add the indicator to the chart before placing the strategy, and do you still get the error?

    As a test, can you add and enable your strategy and then add some other/different indicator such as an SMA, do you get an error then?

    We need to isolate what is generating the error.

    What is the indicator being used in addChartIndicator()?

    What is the indicator being added separately?

    Comment

    Latest Posts

    Collapse

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