Announcement

Collapse
No announcement yet.

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.

    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.

        Comment

        Latest Posts

        Collapse

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