![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Thanks MrPip, I will look at this in the afternoon. I tried to use some of the SkyDart code but it just got all messy on me. I'm not a seasoned coder like you, but I will pat myself on the back for creating my midnight variable so if the time passes midnight it adjusts properly![](https://c.mql5.com/forextsd/smiles/teeth_smile.png)
I like your the idea of going down to the minute because after a closer look this morning, my old code put me in a trade during the 800 hour when I wanted it to stop by 800. My code had a stop hour = 8, which means it can take orders up to 59. Your code would have been better and more detailed if the stop hour =0800.
Thanks again, plus this should help out Ruf.
Minnelli
Forex Signal Providers - Journal
What about an EA to put two trades like a buy/stop and sell/stop at certain time like 00:00 gmt hours base on the open price + 50? Like if the open price is 1.9900 then make a buy/stop at 1.9950 and a sell/stop at 1.9850 with a stop loss of 30 or so. Be nice if one of the coders would do that for me. I don't think it's a hard EA at all for some of the veteran coders.
Stop Hour
Thanks MrPip, I will look at this in the afternoon. I tried to use some of the SkyDart code but it just got all messy on me. I'm not a seasoned coder like you, but I will pat myself on the back for creating my midnight variable so if the time passes midnight it adjusts properly
I like your the idea of going down to the minute because after a closer look this morning, my old code put me in a trade during the 800 hour when I wanted it to stop by 800. My code had a stop hour = 8, which means it can take orders up to 59. Your code would have been better and more detailed if the stop hour =0800.
Thanks again, plus this should help out Ruf.
Minnelli
Forex Signal Providers - JournalI have not looked at your code but you would need to use Hour() < stophour for the filter. That way when Hour() = stophour you would not place a trade.
That is how my function works.
Robert
Already done
What about an EA to put two trades like a buy/stop and sell/stop at certain time like 00:00 gmt hours base on the open price + 50? Like if the open price is 1.9900 then make a buy/stop at 1.9950 and a sell/stop at 1.9850 with a stop loss of 30 or so. Be nice if one of the coders would do that for me. I don't think it's a hard EA at all for some of the veteran coders.
This has been done in Hans123 and variations.
You would need more rules than just place buy stop or sell stop. What happens when one is hit? Do you delete the other? What happens at end of day if neither is hit? Or if one is hit but not yet closed?
There are other issues that would need to be decided as well.
Robert
MrPip,
Yeah I seen hans123 but that I believe was base on certain range which I don't remember. I just want one that I can input certain pips from the open price at that hour. Also yeah like you said that one needs to cancel after the other is trigger and just closed the trade at the end of the day.
Started new thread over here. Big thanks to MrPip for providing the initial code!!!
https://www.mql5.com/en/forum/177362
Ea
Hello All
Does anyone have an EA that do not allow the trades in certain time. For example if you attach it to GBP/JPY it will not allow other EA to put a pending or market price orders for this pair in certain time like
Do not open trade between 4:30 to 5:30
and between
8:30 to 9:00
and between 10:30 to 11:00
The EA will not allow just one EA to put the orders and it will define it by its magic number.
Your help is appreciated
Moved your post to this thread where you can find some codes and discussion about similar idea.
The other usefull thread related to this subject is here https://www.mql5.com/en/forum/177362
Question?
I have an indicator.
I need to refresh it every bar.
How do I do it so that the EA refreshes it somehow every tick?
Also, what is the code to turn off EA or turn on EA? Is that possible?
Also, how do I do it so that before the EA turns off, it remembers something when it starts up again?
Thanks,
Julia.
I moved your post to this thread where i hope you will find some answer.