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

Custom indicator with array type parameter

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

    Custom indicator with array type parameter

    Hi,

    I am trying to create an indicator that takes an array of doubles as a parameter. I got the thing working as an indicator on a chart, but I am having problems using it in strategies. The autogenerated portion of the code (namely the constructors referenced in strategies) is not picking up the new field.

    I have made the following changes to the indicator, declaring it in the variables and properties regions, as well as initializes to a blank array...

    <code>

    #region Variables
    private double[] bucketBounds;
    #endregion

    ...
    protected override void Initialize()
    {
    bucketBounds = new double[4];
    }
    ...

    #region Properties

    [Description("...")]
    [GridCategory("Parameters")]
    public double[] BucketBounds
    {
    get { return bucketBounds; }
    set { bucketBounds = value; }
    }

    #endregion
    </code>

    Am I missing something? Thanks

    #2
    Lavafang, welcome to the forums - will look into it, pretty sure though the wrappers could not support the array input though in their automatic constructor generation.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Just an FYI for anybody who stumbles on this thread:

      my workaround was to rewrite the array of doubles as a CSV string, and pass that to the indicator. The indicator then parses this into an array of doubles. Not ideal, but it works well enough.

      Comment


        #4
        Thanks for letting us know, we confirmed in our testing the automatic wrappers created would currently not support that. However we have added this item to our feedback trackings and will consider it for potential enhancement.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,609 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        9 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        19 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        6 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        16 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X