Trades only 8 am – 3 pm
24 replies
Hello, I would like to go long only at certain times eg 8am – 3 pm. Optional 5-9 clock.
It does not work in the backtest. The orders are opened only in the time from 8 am to about 10 am.
What could it be? Here my example:
よろしくお願いいたします
0
hello, thank you for the file, I’ll test it! Now I also see how to get the brackets in the rules;)
0
Hello, I would like to close an open position in the time from 16:55 to 16:57. The problem is that the Pos from 16:55 to 16:59 is currently always closed. Starting at 16:58, the position should not be closed and in the example “minute [0} <= 57” has been added. After 17 o’clock everything is okay and the position is not closed. Nevertheless, the code does not work. Does anyone have an idea what’s wrong with that?
0
こんにちは、,
maybe try to insert another Hour[0] >= 16 before the Minute[0] <= 57.
Conmariin 🙂
エキスパートアドバイザーによる自動取引
https://www.rabenesche.de
また、以下の分野でも活動しています:
https://forums.babypips.com/u/ravenash
0
こんにちは,
I am not sure I understand but why can’t you set Hour[0] = 16 instead of “>=”
0
yes, that’s exactly why I thought I used “= 16” and “= 30” instead of “> =”, but it did not work with “=” …. funny
0
Hello, in my example, a long position should be opened only in the period from 8:05 to 15:05 and from 16:05 to 22:30 clock. In addition, long positions 15.20 (not yet integrated in the example) and 22:50 will be closed. There seems to be a mistake in logic as all long positions close immediately after 4:05 pm. Where is the mistake ? thanks for ideas
0
こんにちは,
just to make things completely clear
- you open a trade between 8:05 to 15:05 and close immediately at 15:20
- then you open a trade between 16:05 to 22:30 and close at 22:50
Is there correct?
0
Hello tomas, Yes ! Positions may only be possible from 8:05 to 15:05 or from 16:05 to 22:30. Long positions are closed exactly at 15:20 and 22:50. Unfortunately, the long positions are closed immediately after 16:05(my picture). So the trading time are set from 8:05 to 15:05 and from 16:05 to 22:30. Close position 16:05 and 22.30.
0
Hello, I found the problem. The times must be specified from “> =” to “<=”. like this:
Hour[0] >= 8
Minute[0] >= 5
Hour[0] <= 15
(Minute[0] <= 5
0