You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Here is the original start() function from this indicator
The function uses calculation of the average. It needs to be replaced with a standard function.
It looks like this
Attached is the variant of the indicator with the correction
Now on to the logic of the indicator itself (I'm not saying that the proposed version is ideal)
I just like it better
A good example. But it is more about optimization than logic.
And logic too, the logic of thinking.
The third option is to abandon the logical conditions in the indicator completely. The question arises - is it possible.
Let's try
For this let's add a couple of logical variables
The entire code of the start function now is
if(counted_bars < 0) return(-1);
Based on what logic is this line present?
if(counted_bars < 0) return(-1);
Based on what logic is this line present?
It's not my line. It's the author's
Optimal code for start()
Comparative analysis of the work options
Optimal option number 2. Boolean conditions cannot be discarded
Option 5 is based on it
Forgot all about the script
Forgot all about the script
I would like to add about the section criticised by gip:
I don't understand why we have to dance around boolean variables when we can write it this way: