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 JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        18 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        6 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Working...
        X