Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

make indicator visualize from strategy

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

    make indicator visualize from strategy

    From strategy, I called my indicator in (State == State.DataLoaded).

    Code:
    AddChartIndicator(Myindicator);
    However, I noticed that, once I called this, there will be always an error pop out
    14/1/2021 3:32:02 PM Default Unhandled exception: Object reference not set to an instance of an object.
    Another funny thing is i can add indicator even though there is a pop our message, but cannot cancel it.

    Can i know why ??

    #2
    Hello soon123,

    Thanks for your post.

    AddChartIndicator() provides the convenience of adding the indicator to the chart automatically when the strategy is loaded.

    I would comment out the AddChartIndicator (and any associated lines) and verify that without that the strategy then does not generate the error.

    Assuming you do not get the error, then a next step would be to add a known indicator such as an SMA and observe if this causes any errors.

    Beyond that you would need to start the debugging process by adding print statements to find out at what line the error is generated.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by lucileaglaser, Today, 07:41 PM
    0 responses
    1 view
    0 likes
    Last Post lucileaglaser  
    Started by lucileaglaser, Today, 07:37 PM
    0 responses
    1 view
    0 likes
    Last Post lucileaglaser  
    Started by woodruaj, Today, 06:15 PM
    0 responses
    3 views
    0 likes
    Last Post woodruaj  
    Started by CarpetHooligan, Today, 03:55 PM
    0 responses
    3 views
    0 likes
    Last Post CarpetHooligan  
    Started by forrestang, Today, 02:36 PM
    2 responses
    12 views
    0 likes
    Last Post forrestang  
    Working...
    X