Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1478
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
Yes
Thanks for the help. If I'm not mistaken, despite the fact that void OnTick() handles each tick, if we useTimeSeconds() inside it, then void OnTick() will handle not each tick, but only the beginning of each minute candle and thus will save runtime of the whole code.
Tell me, if instead of TimeSeconds(), you write in the condition if(Minute() != x), and at the end x= Minute(), it will have the same effect as TimeSeconds()?
Thank you
Thanks for the help. If I'm not mistaken, despite the fact that void OnTick() handles each tick, if we useTimeSeconds() inside it, then void OnTick() will handle not each tick, but only the beginning of each minute candle and thus will save runtime of the whole code.
Tell me, if instead of TimeSeconds(), you write in the condition if(Minute() != x), and at the end x= Minute(), it will have the same effect as TimeSeconds()?
Thanks
It's better, you will have a timer outside of sessions as well. And only on a new candle.
But why do you need it that way since it is easier to place a grid of pending orders at the first extremum? This is essentially the same thing with you. The first condition is identifying the extremum and then, if the trend goes down, the orders will be placed after 30 points.
The flagging is needed to work out immediately after being thrown onto the chart. If not needed, then remove the flagging.
Better still, you will have the timer running out of sessions. But only on a new candle.
And why would you do that, because it is easier to place a grid of pending orders from the first extremum? This is essentially the same thing with you. The first condition is identifying the extremum and then, if the trend goes down, the orders will be placed after 30 points.
The flagging is needed to work out immediately after being thrown onto the chart. If it is not needed, then remove the flagging.
My order opens 30 pips upwards from the local low, i.e. BID minus MINIMUM >= 30 pips.
Thanks for your participation. I will now start to delve into your tips....
Better still, you will have the timer running out of sessions. But only on a new candle.
And why would you do that, because it is easier to place a grid of pending orders from the first extremum? This is essentially the same thing with you. The first condition is identifying the extremum and then, if the trend goes down, the orders will be placed after 30 points.
The flagging is needed to work out immediately after being thrown onto the chart. If we do not need it, we will remove the flagging.
There was a local minimum. And I set 10 pending orders at the distance of 30,32,34...pips from the local minimum. And then the local low was updated before the price reached the first pending order, and I have to set all the pending orders once again. The way I see it, setting and resetting the pending orders takes a lot of time. And I'm trying to save it.
Better still, you will have the timer running out of sessions. But only on a new candle.
And why would you do that, because it is easier to place a grid of pending orders from the first extremum? This is essentially the same thing with you. The first condition is identifying the extremum and then, if the trend goes down, the orders will be placed after 30 points.
The flagging is needed to work out immediately after being thrown onto the chart. If not needed, then remove the flagging.
I would be glad if my timer was flogging. But as it turned out in the MT4 tester, the timer does not work.
Thanks for the help. If I'm not mistaken, despite the fact that void OnTick() handles each tick, if we useTimeSeconds() inside it, then void OnTick() will handle not each tick, but only the beginning of each minute candle and thus will save runtime of the whole code.
Tell me, if instead of TimeSeconds(), you write in the condition if(Minute() != x), and at the end x= Minute(), it will have the same effect as TimeSeconds()?
Thank you
It's better this way,
Can you tell me why we need a "FlagNewBar"?
Isn't it the same thing?
MakarFX:
I still do not understand if using the TimeSeconds() or TimeMinute() functions in this case is fundamental and obligatory? After all, you can get the same result as with these functions using one function - Minute( )
if(Minute()!= x)
{
action
x= Minute();
}
Thank you.
I still do not understand if using the TimeSeconds() or TimeMinute() functions in this case is fundamental and obligatory? After all, you can get the same result as with these functions using one function - Minute( )
if(Minute()!= x)
{
action
x= Minute();
}
Thank you.
Can you tell me why the "FlagNewBar" is needed?
Isn't it the same thing?
It's a habit from BASIC. It's easier to use it) You can do it without it.) And if the condition is inserted in several places, the record is shorter.
Zy. If the logic is branched and hysteresis, you can't do without flags. And it's convenient to print them)