[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 301
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
There is no trade at the weekend.
to Reshetov^ Like this: int start() { Comment("Open positions: ", OrdersTotal()); string smb=Symbol(); int tf=Period(); gsID=smb+IsDemo()+IsTesting()+IsOptimization()+"."+Magic; inf=""; INF(TTS(TimeCurrent()), true); main(Magic, smb, tf); Comment(inf); and where and how is the number displayed?
Can you tell me how to work with ArrayMaximum in the EA? In the indicator it works, I marked arrays and buffers, but in the EA it is not clear.
You need to prepare the array first. Try the script given in the MetaEditor's help:
You need to prepare the array first. Try the script given in the meta-editor's help:
In my indicator it looks like this:
sm[i]=...........;
double IndexMaxValue=ArrayMaximum(sm,n,shift);
I don't know how to attach it to your script, how to do it in the Expert Advisor?
I can output sm[i] via iCustom, but how can I put the iCustom variable into ArrayMaximum?
but how can iCustom variable be put into ArrayMaximum it's not an array?
I didn't cite the documentation for nothing. There is such a thing as description of parameters which should be given as input to a function. If it says there that the parameter must be an array name, shoving another function (iCustom() in particular) will lead to nothing good. It means that before calling ArrayMaximum() we should declare an array and then fill this array with values and only after that you can call ArrayMaximum()
.
I tried to put the code of the indicator itself into the EA, but nothing works, IMHO the point is that the indicator needs to indicate buffers and I haven't seen it anywhere in EAs, that's why the indicator works, but the same code doesn't work in EAs. I have an array filled with cycle sm[i] and indicator sees it but EA with the same code does not. Maybe, the arrays in EAs should be declared differently than in indicators?
Work it out - no questions asked: https://www.mql5.com/ru/articles/mt4