Then, TimeGMT or TimeCurrent does not equal time1
TimeGMT & TimeCurrent are the current server time, in your code you are trying to compare them with a historical time, it will never match
So how do i write : when a specific time come .. it open a trade?!
https://www.mql5.com/en/forum/293560
go here
- 2018.12.04
- www.mql5.com
hello ,, i have a little problem in this function , when the time aarived as i mentionned it does not open any position ,, what should i add or change ?
Ps; when i make the variable StrToTime it make ''possible of loss of data due to type conversion
and the second one it shows any problemm but when i test it it don't give any open position at that time
Do it this way.
datetime time1= D'2018.05.23 05:05:00';
Keep in mind that your code only runs when a tick comes in.. if a tick does not come in during that second it will not trigger a trade.. when the tick finally comes in it will be past the right time.. you may want to say.
if(TimeCurrent()>=time1)//then make sure it can only enter once. with some other code.
Pip Pip.. Jimdandy
Do it this way.
Keep in mind that your code only runs when a tick comes in.. if a tick does not come in during that second it will not trigger a trade.. when the tick finally comes in it will be past the right time.. you may want to say.
Pip Pip.. Jimdandy
it worked ,, thank you very mush sir i owe you
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hello ,, i have a little problem in this function , when the time aarived as i mentionned it does not open any position ,, what should i add or change ?
Ps; when i make the variable StrToTime it make ''possible of loss of data due to type conversion
and the second one it shows any problemm but when i test it it don't give any open position at that time