Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1358
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
MakarFX , what function does this bind: what function does it perform ?
input int BarTrade = 5; // I understand that this is the number of the tracked periods of 5.
int TimeBarTrade=BarTrade*Period()*60; // how do I understand? Why is it multiplied by 60?
MakarFX , what function does this bind: what function does it perform ?
input int BarTrade = 5; // I understand that this is the number of the tracked periods of 5.
int TimeBarTrade=BarTrade*Period()*60; // how do we understand? Why is it multiplied by 60?
BarTrade*Period()*60
number of bars * current timeframe * 60 seconds
i.e. bar quantity converted to seconds
BarTrade*Period()*60
number of bars * current timeframe * 60 seconds
i.e. number of bars converted to seconds
You can do it this way.
If you exclude errors related to
MODE_STOPLEVEL, MODE_TRADEALLOWED, MODE_MINLOT, MODE_LOTSTEP, MODE_MAXLOT
then the owls won't be hitting the server.
Makar, thank you very much for pointing out what checks need to be done to avoid distressing the server and banning the EAJ.
Checks done like this
mod stop level for stop
mod stop level for profit
Check for trade authorization
Checking for max and min lot
First I got max lot and min lot values in the variables like this
And then I check somewhere below as I write the Grail
Is this correct or am I wrong?
I didn't check for lot step change because lot is calculated as a percentage of deposit and there this value is multiplied by a point and normalized - this check may be omitted - right, or should I do it anyway? If we still need to check how to write this check?
The main point of all these checks is to always have the correct value of stop, profit, and lot size, so we can generally start opening orders. If all these parameters are OK, the Expert Advisor will not bother the server; do I understand this correctly?
Thank you very much, Makar, for telling me what checks to do to avoid the server and banning the EAJ.
//ПРОВЕРКА НА МОДЕ СТОП ЛЕВЕЛ- МИНИМАЛЬНЫЙ УРОВЕНЬ СТОПА
// ПРОВЕРКА ТЕЙК ПРОФИТА НА МИНИМАЛЬНО ДОПУСТИМУЮ ВЕЛИЧИНУ УСТАНОВКИ
There may be a 130 error here due to slippage.
I would do this
Hello all, has anyone had a problem with dangling points on the chart found through iHighest/iLowest?
Prehistory: I have minimal programming experience, I'm writing an indicator in mql4 which should display the points on the chart, found by the conditions of if and connect them with lines. Logically, it looks for the points correctly, but draws them with an offset, then for 2 bars, then for 3 bars. How do I fight this? I have attached the file with the code too.
Hello all, has anyone had a problem with dangling points on the chart found through iHighest/iLowest?
Prehistory: I have minimal programming experience, I'm writing an indicator in mql4 which should display the points on the chart, found by the conditions of if and connect them with lines. Logically, it looks for the points correctly, but draws them with an offset, then for 2 bars, then for 3 bars. I have attached the file with the code as well.
The points are drawn correctly, without an offset.
If the condition is fulfilled and iHighest/iLowest are bigger or smaller than the current High/Low
it draws
points are drawn correctly, without offset
if the condition is met and iHighest/iLowest is greater or less than the current High / Low
then draws
So, I think I'm beginning to realize my mistake) It turns out that to visually display these points in the right place, I need to enter some separate counter instead of n for myAZBuffer[n], ExtLowBuffer[n], ExtHighBuffer[n] ? but how to do it
no, you understand correctly.
the condition uses two or three bars from the history,
that's why it draws after 2-3 bars when the condition is met
no, you understand correctly.
the condition uses two or three bars from the history,
that's why it draws after 2-3 bars when the condition is met