The REF do not run 'if' and repeated executed.

Questions about MultiCharts and user contributed studies.
L.R
Posts: 1
Joined: 16 Mar 2014

The REF do not run 'if' and repeated executed.

Postby L.R » 16 Mar 2014

Main code
Image

In this section of the code,
the specified parameter (mode) decide which function to run(There are three functions)
And,These 3 functions using the REF for returning the value.

The declaring of parameter in function as below:

Image
ImageImage


Each function uses a different way for operating data, but uses the same arrays for returning the computed value.
It's abnormal that MC will execute all 3 functions,
It causes the value in the arrays will be the last function computed instead of varying with each conditional 'if'.


My question is:
How to make the function only execute when the conditional 'if' fulfilled?

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: The REF do not run 'if' and repeated executed.

Postby Andrew MultiCharts » 18 Mar 2014

Hello L.R,

It works as you expect if all three functions have Function Storage = Simple


Return to “MultiCharts”