Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Complex parameters / parameters set

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

    Complex parameters / parameters set

    Hi!

    I have an indicator which does some things depending on parameters x, y and z which can be changed in the indicator options by the user.

    There can be multiple parameter "sets" though. How do I implement this?

    So the indicator should do something for example if:

    x = 1 and y = 1 and z = 2

    OR

    x = 1 and y = 1 and z = 3

    OR

    x = 2 and y = 0 and z = 2

    I thought about using files but not sure whether that's a smart idea because the parameters change depending on the stock/instrument.

    I appreciate any ideas. Thanks!

    #2
    Hi Orion, thanks for writing in.

    You can make multiple instances of the same indicator in your script that have different parameters. I attached a example for reference.

    Please let me know if this does not resolve your question.
    Attached Files

    Comment


      #3
      Hi Chris, unfortunately not.

      I don't know how many sets of parameters there are and I also need the parameter values of each set to be checked together.

      Optimally I would be able to loop through "sets of parameters" and execute my logic based on that.

      Thanks for your help!

      Comment


        #4
        Hi Orion, thanks for your reply.

        You can call the indicator "on the fly" within OnBarUpdate and that way you can loop through a set of parameters. Make sure to check that there are at least x bars on the chart where x is the largest lookback period for the indicator e.g.

        OnBarUpdate:

        if(CurrentBar < MaxPeriod)

        for(int i = 10; i < MaxPeriod; i++)
        {
        Print(SMA(i)[0]);
        }

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        336 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