Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is there a work around for not hard coding additional data series?

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

    Is there a work around for not hard coding additional data series?

    For example, I would like to use the below, but I understand that it may fail if it's not hardcoded. I have not really had issues with using variables, but do wonder if there is any work around for it without having to go back to modify the code or what if a user doesn't have access to the source code to modify it?

    Code:
    AddVolumetric(Instrument.FullName, BarsPeriodType.Minute, MaxBarLookBack, VolumetricDeltaType.BidAsk, 1);

    #2
    Originally posted by walley View Post
    For example, I would like to use the below, but I understand that it may fail if it's not hardcoded. I have not really had issues with using variables, but do wonder if there is any work around for it without having to go back to modify the code or what if a user doesn't have access to the source code to modify it?

    Code:
    AddVolumetric(Instrument.FullName, BarsPeriodType.Minute, MaxBarLookBack, VolumetricDeltaType.BidAsk, 1);
    It really depends on your use case.

    Is this for personal use only?
    If so, then don't worry about it.
    Why? Because nothing to fix until your use case causes it to break.

    -=o=-

    Otherwise ...
    Is this for an Indicator or Strategy?
    If Indicator, will it ever be used by a Strategy?
    If Strategy or Indicator used by a Strategy, are you ever going to Backtest w/Strategy Analyzer?
    If Strategy or Indicator used by a Strategy, are you ever going to Optimiize w/Strategy Analyzer?

    I think the 'hardcoded' warning is due to how the Optimizer works
    in Strategy Analyzer ... otherwise, you might be fine.

    Just my 2˘.


    Comment


      #3
      The workaround to avoid the hard-coded problem, yet
      still provide some degree of user customization, is to use
      a string property for the property grid -- ie, making the user
      provide the full instrument name via a string parameter is
      the happy medium you're looking for.

      Comment


        #4
        Hello walley,

        Thanks for your post.

        We do not have any supported workarounds for not hardcoding the arguments into the AddDataSeries() method. Currently, it is not reliable or supported to do this, since objects such as Instruments, Bars, BarsPeriods, etc. are not reliably accessible in State.Configure.

        Interest is being tracked in an existing feature request to support dynamically adding data series to a script using AddDataSeries() and I have added your vote.

        This request is being tracked under the number SFT-882.

        As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted on the Release Notes page of the Help Guide.

        Release Notes — https://ninjatrader.com/support/help...ease_notes.htm
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X