Bar mode flags vs. weekend parameter

Posted By: vince

Bar mode flags vs. weekend parameter - 02/08/20 10:42

Hi,

since https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=478863#Post478863 is still unanswered and the thread is closed now, let's try it here again:

Quote
Originally Posted by jcl
The Z systems have their own bar mode flags, so the weekend parameter is not needed anymore.


With the weekend parameter we had two holidays included by default:
"December 25 and January 1 count as weekend. Other holidays are not automatically included, but can be taken account of in the script."
25.12. is also included in the new bar mode on Z strategies, but apparently the 1.1. is not...
Tested with Zorro 2.20.2:
Z2 tried to open several positions during New Year's Day and wanted to close one position here. After the market opened again at 23:00 it immediately closed that position under very bad conditions (huge spread due to just opened market). The positions it previously wanted to open on 1.1. it didn't try again after the market opened, though.
Is there any way to specify the holidays / market closed periods for the Z strategies? Or is it just a bug in the bar mode flags or the usage in the Z strategies scrips that will be fixed in the future?
Thanks.
Posted By: jcl

Re: Bar mode flags vs. weekend parameter - 02/11/20 11:55

January 1 is still a holiday. I'm sorry that you lost money, but it is certainly not due to "huge spread" and adding more holidays would not help. If you would declare January 2 also a holiday, then that trade would be closed on January 3 with a likely even worse result.
Posted By: vince

Re: Bar mode flags vs. weekend parameter - 02/11/20 19:36

Originally Posted by jcl
January 1 is still a holiday.

But why did Z2 then try to trade on that day? I got several "can't close" and "can't open" messages during January 1. On Christmas on the other hand Zorro properly suspended trading:
Code
Market closes on 25.12. 00:00
Market opens on 26.12. 00:00

Originally Posted by jcl
I'm sorry that you lost money, but it is certainly not due to "huge spread" and adding more holidays would not help.

Well, the trade was closed with profit...
But I still think that opening or closing a trade immediately after the markets opened (--> big spread) is not beneficial and waiting until spreads came down to a more normal level is a better option. I guess if the strategy properly suspended trading on 1.1. it would not have closed the trade at the first chance it could (to rectify the previous omission of the closing) but would maybe have decided only at the next "strategy action time" at 1:xy AM to close it.
Markets opened at 23:00 and Zorro closed the trade at 23:00:03 (22:00:01 in Zorro's log)):
Code
[Wed 20-01-01 08:06] ...
Error 075 [EUR/USD:CY:L0179] - can't close 1@0.0 at 08:06:01
(EUR/USD:CY:S) Short 4@1.12216 Entry limit
(USD/CAD:HP:L) Long 3@1.29893 Entry limit
Error 075 [EUR/USD:CY:L0179] - can't close 1@0.0 at 08:06:01
Error 075: (AUD/USD:CY:S) - can't open 2@0.0013000 Stop 0.069771 at 08:06:01

[Wed 20-01-01 12:06] ...
Error 075 [EUR/USD:CY:L0179] - can't close 1@0.0 at 12:06:00
Error 075: (EUR/USD:CY:S) - can't open 4@0.00090000 Stop 0.044253 at 12:06:00
Error 075: (USD/CAD:HP:L) - can't open 3@0.0 Stop 0.047206 at 12:06:00

[Wed 20-01-01 16:06] ...
(USD/CAD:CY:L) Long 4@1.29900 Entry limit
Error 075 [EUR/USD:CY:L0179] - can't close 1@0.0 at 16:06:01

[Wed 20-01-01 20:06] ...
Error 075 [EUR/USD:CY:L0179] - can't close 1@0.0 at 20:06:00
Error 075: (USD/CAD:CY:L) - can't open 4@0.0 Stop 0.048620 at 20:06:00
[EUR/USD:CY:L0179] Sell 3@1.12122: +29.49 at 22:00:01
© 2024 lite-C Forums