Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 899
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
Thanks, but it doesn't work with Mas[N]; in OnInit(), I've already tried it.
Well I'm sorry, I wasn't very sober last night. Or not very sober.
Suppose I want the array to be filled with data taken from an indicator (for example ATR) from each bar starting from the first formed bar (#1)? That is, the array is declared and the start function already initializes it. How to do it correctly?
like this?
for(int i=0; i<N; i=i++)
Mas[i]=iATR(NULL,0,1,i+1);
}
Or it can be done via:
for(int i=0; i<N; i=i++)
{
ArrayFill(Mas,i,1,iATR(NULL,0,1,i+1))}
or something else entirely?, so far I have not succeeded in any way(, something wrong, please advise, thank you in advance.
Suppose I want the array to be filled with data taken from an indicator (for example ATR) from each bar starting from the first formed bar (#1)? That is, the array is declared and the start function already initializes it. How to do it correctly?
like this?
for(int i=0; i<N; i=i++)
Mas[i]=iATR(NULL,0,1,i+1);
}
The first option is sufficient. But if we need values starting from the first bar, it would be more reasonable to count the cycle from 1.
I tried it with both 1 and 0, it still doesn't work, no values are written, when I ask to output some - it just outputs zeros.
Show the code to ask for the output.
I'll show you all the code just in case:
Use SRC to insert code
I'll show you all the code just in case:
make an array of type double
This does not solve the problem, now it seems that something is wrong inOnTick() - when I load the EA in the terminal window nothing happens, and when I try to delete it, the terminal stalls for a very long time and then deletes it after some time. I tried to manually assign values to some elements, everything is OK. Something about the array initialization loop seems to be wrong.
What do you mean it "doesn't solve"? You're shoving data of double precision below 1 into the Int array, the output will naturally contain zeros. Well, the loop was crippled as well.
This code should work: