Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ms52390, 06-20-2024, 03:48 PM
        2 responses
        14 views
        0 likes
        Last Post ms52390
        by ms52390
         
        Started by ccrone2024, Today, 05:13 AM
        0 responses
        7 views
        0 likes
        Last Post ccrone2024  
        Started by ttodua, Today, 03:40 AM
        0 responses
        6 views
        0 likes
        Last Post ttodua
        by ttodua
         
        Started by ttodua, Today, 03:18 AM
        0 responses
        7 views
        0 likes
        Last Post ttodua
        by ttodua
         
        Started by TraderKnG, Today, 01:30 AM
        0 responses
        13 views
        0 likes
        Last Post TraderKnG  
        Working...
        X