Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1246
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
What are you typing in so many lines of code with? Here is one of my latest EAs, working with a set of securities on FORTS
As many securities will be listed in this list, so many will trade. And this EA with control of two trading timeframes, with trailing and of course with analysis, only 326 lines.
If you want to use switch, you don't have to add position opening in each variant. It is enough to specify the symbol name, type of trade operation and the
But it would be better, in my opinion, to wrap it all in a user-defined function.
Thank you. But it's not that intolerant, it's just that this was my first variant of writing and, in my opinion, it is more universal. We could add all kinds of analysis methods and not write an order opening in each one, just because it wouldn't be necessary and focus on analysis and new functions instead of writing the same thing. I don't know how I crammed it into 300+ lines, I'm not that advanced in this language. In the end I have written everything in each function and came out with 1050 lines without taking into account everything else, like lot calculation, trailing, etc. The Expert Advisor may only open deals on 7 pairs simultaneously considering opening conditions, and that's all in principle. Then I want to write a new function and have to prescribe opening of orders again and again and again, instead of writing it once and using it. Trailing stop works all the time and modifies all open orders, but it is written once, so why not write once function to open orders and use it for any type of analysis. It's not clear to me yet.
If you have more than one symbol in operation, the most effective option is to work with a custom function. For each symbol, in my variant, the function analyses the opening from the array and if the analysis function returns true, it calls the function to open an order. One function analyses the situation for all symbols one by one and opens orders for the symbol with a signal. It does not matter how many symbols are in the array. We have received a signal, opened an order, returned to the array of symbols, check the next one. And so on...
If you have more than one symbol in operation, the most effective option is to work with a custom function. For each symbol, in my variant, the function analyses the opening from the array and if the analysis function returns true, it calls the function to open an order. One function analyses the situation for all symbols one by one and opens orders for the symbol with a signal. It does not matter how many symbols are in the array. We have received a signal, opened an order, returned to the array of symbols, check the next one. And so on...
That's a good one.
Alexey is telling you standard stuff...
Alexei is telling you the standard stuff...
Standard is when there is a separate code for each day. )))))
Alexei is telling you the standard stuff...
Well, I'm in my third week with this language\.
Since 2008, but I'm just now trying to write something.
Hello @Artyom Trishkin ,
I'm having trouble solving the logic. Please help me with it? Here's a link to my thread: https://www.mql5.com/ru/forum/350570
Hope to hear from you later.
Calculate the median price on a given interval with a given number of approximations.
Hello There is an array of values.
The task is to write a function.
Input parameters:
- the array contains numbers of required elements to calculate the median - bufInBar[]
- array size -bufInBar[] - count
- number of median approximations - fokus
That is, there is a class
bufInBar[i] - используется для загрузки нужного элемента при расчете медианы BP[bufInBar[i]].CenaPerioda; - по этому значению рассчитывается медиана BP[bufInBar[i]].Period;
On output :
Filled in ascending order e.g. from 0 to 10.
That is, iffokus=10 in the condition, then at the interval i<count, ten values
will be 1 to 10.
For example
Ready to transfer $12 from the account
Calculate the median price on a given interval with a given number of approximations.
Ready to transfer from the account $12
you know that for something like thishttps://www.mql5.com/ru/job
and here - if you started to do it yourself, but it didn't work out or isn't clear