Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Take parameter as the condition to decide adddataseries

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

    Take parameter as the condition to decide adddataseries

    I having testing in my strategy analyzer with the optimization type.

    I will add the dataseries however when i use 1 of the parameter as the condition, it will always show false.
    Can i know how to overcome this ???

    #2
    Hello cincai,

    Thank you for your post.

    Are you attempting to dynamically add a data series based on specific conditions? Dynamically adding a data series is unsupported, and specifically for optimizations will not work. From our help guide:

    "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner."

    If you use a variable to select the instrument, bar type, or interval of a secondary series, this variable cannot be optimized over.

    Any added dataseries cannot change between optimizations.

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, Yesterday, 09:41 PM
    1 response
    20 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, Today, 02:41 AM
    0 responses
    6 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, Yesterday, 11:44 PM
    0 responses
    17 views
    0 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    33 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    32 views
    0 likes
    Last Post CarlTrading  
    Working...
    X