Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

parameter order when calling indicators

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

    parameter order when calling indicators

    I have just discovered what seems to me to be an anomaly. I have created an indicator with four parameters, C, D, B and A. They are listed in the variables in that order and are in the same order in the Properties region. However, when I call the indicator from within a strategy I have found that I must specify the parameters in a different order, viz MyInd(A,B,C,D). After many hours of head scratching and experimenting I finally figured out that the parameters must be in alphabetical order of the indicator parameter names for the call to the indicator (and the parameter names used in the call can be in any order). Is this correct?

    Since the names can be completely different in the strategy and the indicator I always assumed the mapping was positional, i.e. the first parameter specified in the call was mapped to the first parameter specified in the indicator, and so on, but this appears to not be the case. Instead it seems the parameters in the call must be listed in the alphabetical order of the parameter names in the indicator. It seems to me this could be a recipe for disaster. If you ever decided to rename any parameters in your indicator, you could inadvertently alter the parameter call sequence, which means (if you noticed it...) you would have to change every call to the indicator in every strategy that uses it.

    Wouldn't it be a heck of a lot easier to map the parameters by position than by name? From my limited understanding of programming, I thought that was pretty standard. It might make it a bit easier to list the parameters in the order defined rather than alphabetical in all the other places that people have been complaining about (like the strategy window) rather than having to use \t or adding a prefix to the parameter name.

    Thanks,
    Ian

    #2
    Ian, thanks for the feedback - correct the parameters are internally ordered alphabetically, this is expected behavior.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    569 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 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
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X