Reply

Trades only 8 am – 3 pm

24 replies

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #232923

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:

Best regards

Attachments:
You must be logged in to view attached files.

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

6 years ago #233303

hello, thank you for the file, I’ll test it! Now I also see how to get the brackets in the rules;)

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

5 years ago #233382

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?

Attachments:
You must be logged in to view attached files.

0

Conmariin

Subscriber, bbp_participant, community, customer, 54 replies.

Visit profile

5 years ago #233387

Hi,

maybe try to insert another Hour[0] >= 16 before the Minute[0] <= 57.

Conmariin 🙂

Automatisches Handeln mit Expert Advisor
https://www.rabenesche.de

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

5 years ago #233396

Hello,

I am not sure I understand but why can’t you set Hour[0] = 16 instead of “>=”

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

5 years ago #233397

yes, that’s exactly why I thought I used “= 16” and “= 30” instead of “> =”, but it did not work with “=” …. funny

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

5 years ago #233447

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

Attachments:
You must be logged in to view attached files.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

5 years ago #233465

Hello,

just to make things completely clear

  1. you open a trade between 8:05 to 15:05 and close immediately at 15:20
  2. then you open a trade between 16:05 to 22:30 and close at 22:50

Is there correct?

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

5 years ago #233477

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

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

5 years ago #233490

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

Viewing 9 replies - 16 through 24 (of 24 total)

1 2