How to hourly enter?...
-
Hi guys i'm very newbie here. I like a lot fxdreema but i have to learn.
I'm trying to build a very simple EA which opens BUY orders at the beginning of new candle on H1 at 4:00, 5:00, 15:00, 17:00, 20:00 GMT; and SELL at 0:00, 1:00, 3:00, 7:00, 21:00, 23:00 GMT. No TP, no SL, just exit at the end of the candle.Is it right if i use 2 hour filter function for "buy now" (because each allows only 4 periods when i need 5), and 2 for "sell now"?

Thanks
-
@alessandromagno I do it on this way: I like to controle the server time for my timezone becaus of my broker has the same one! There are a lot of possibilities.....

-
Thanks man. Now for the closing trade at the end of the candle what should i do?
-
@alessandromagno ...try these for the Buy-side and check candle ID; you can delete the block 'For each Trade'; TIPP: NEVER EVER without STOP!!!!!!!!
good luck!
-
@dieter
Man with that exit method it opens and close the trades at the same time, not at the end of candle...meanwhile i'm trying but with poor results. Here you can see what i'm building, but it only sometimes enters a trade at the beginnings, and most of the times it closes after many candles
https://fxdreema.com/shared/GOj9xqond
i'm struggling to find what is going wrong. You can see many start not at the beginning and many close after some candles...

-
@alessandromagno
Dear,
I have attached the mql for the easiest way (Buy-Side: Sell-Side it´s up to you
). But it's better to use the FXDREEMA help in the long run and understand what's going on in the blocks - Software-Structure for big projects - Have fun with your studying.1_1516442680981_candlecloseDieter.mq4 0_1516442680981_candlecloseDieter.ex4

-
If the rules are as simple as you state - here's what you are after
https://fxdreema.com/shared/QfzAfqTJbIt uses the Expiration of the order to close itself.
Because some of your periods are consecutive we can set the hour filter to extend for the 2 periods and by using the Once per bar then it will on perform the buy or sell once in the period.
As you can only set 4 period filters in the Hours Filter the Sell one has one more block to handle the extra.The expirations are "1 hour from the time of the order" which may actually then be a fraction after the candle closes but should be pretty close. You could change it so that it expired 59 mins instead.
I just set the time stuff and conditions to GMT so you may need to vary those according to your requirements.
-
thank you guys for the help. I'll give a try on both to see which performs better!