Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1357

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
And this process should be written after each line in which there is an attempt to open an order using the order-send - right?
After all trades OrderSend(), OrderClose(), OrderCloseBy(), OrderModify(), OrderDelete()
After all trades OrderSend(), OrderClose(), OrderCloseBy(), OrderModify(), OrderDelete()
This has to be written after each line in which there is an attempt to open an order using the order-send - is this correct?
If we exclude errors related to
MODE_STOPLEVEL, MODE_TRADEALLOWED, MODE_MINLOT, MODE_LOTSTEP, MODE_MAXLOT
then the owls won't be pounding the server
If the EA is deleted from the chart, it won't work until I manually upload it again. How can I reset it automatically?
And this case must be written after each line in which there is an attempt to open an order using ordersend - right?
If by "this case" we mean checking the minimum and maximum allowed order volume, step of volume, maximum allowed number of deals+order, sufficiency of free margin (these are the main points, for which the validator rejects most often), then it is more reasonable to write one function, calling it OrderCheck for example.
Then, before opening of any new deal, simply check the volume.
Approximately so:
Good day all dear programmers! I've been struggling with one problem for a day now, and I can't figure it out. Please help me solve it.
The bottom line:
The instrument is RTS futures,period of M5;
Algorithm has to change parameters SL and TP depending on time, and importantly, the open position is closed not by TP ( request.tp = ....) and the counter market order, if certain conditions are met.
There are three intervals: 1) (stm.hour>=12 && stm.sec>=1 && stm.hour<=12 && stm.min<=03) // from 12:00:01 - 12:03:00
2) (stm.hour>=16 && stm.min>=05 && stm.sec>=1) && (stm.hour<=16 && stm.min<=09) // 16:05:01 - 16:09:00
3) (stm.hour>=20 && stm.sec>=11 && stm.hour<=20 && stm.min<=04) // 20:00:11 - 20:04:00
In interval "1)" parameters SL and TP = 200 and 200
At intervals "2)" and "3)", SL and TP = 100 and 100
The problem: The algorithm fixes profit ONLY ON THE CURRENT SWITCH, but we need to keep the profit taking condition for n more candlesticks (at least 10-15)
chart period M5
Alexey Belyakov:
The problem: The algorithm fixes profit ONLY ON THE CURRENT SWITCH, but we need to keep the profit taking condition for n-curves (at least 10-15).
M5 chart period
The SL and TP action is time limited in the code. Separate SL and TP for siesta, and separate SL and TP for siesta
Good day all dear programmers! I've been struggling with one problem for a day now, and I can't figure it out. Please help me to solve it.
Can you change running time and number of bars
Thanks a lot MakarFX ! Now it works as it should !
You're welcome)