Hello,
in WL8 I set the rule
Date is >= December 21
So, shares are bought on 23 December 2024 which is a Monday. But the bar before (on which the signal is created) is the 20 December 2024 and on this bar the condition should not be fulfilled?
If I say "Day of Week is not equal to Friday" there would not be a purchase on a Monday as the signal gets created the Friday before, which is a Friday.
I wonder why the behavior is not the same with dates and I would be curious what the rule is with date conditions like this.
Thank you very much in advance for your help,
Werner
in WL8 I set the rule
Date is >= December 21
So, shares are bought on 23 December 2024 which is a Monday. But the bar before (on which the signal is created) is the 20 December 2024 and on this bar the condition should not be fulfilled?
If I say "Day of Week is not equal to Friday" there would not be a purchase on a Monday as the signal gets created the Friday before, which is a Friday.
I wonder why the behavior is not the same with dates and I would be curious what the rule is with date conditions like this.
Thank you very much in advance for your help,
Werner
Rename
The order is executed on the bar AFTER the signal bar. The signal bar is the last bar for which you have data. Is there data bar on 21 Dec 2024? If there were, the trade would occur on the next bar. Otherwise, assuming no bars on Saturday or Sunday, 23 Dec is the signal bar and the trade would occur on the following bar.
If I you say, "Day of Week is not equal to Friday", the signal bar can never be a Friday.
If I you say, "Day of Week is not equal to Friday", the signal bar can never be a Friday.
I'm not seeing this, when I say buy >= Dec 21, 2024 then my shares are bought on Dec 24. The signal bar is Dec 23 so the position is bought on Dec 24.
I think wernerhh is expecting shares to be bought on 23 Dec.
My explanation is why that's a false expectation - they will be bought on 24 Dec as anyone would see with this rule (assuming the market is not crypto).
My explanation is why that's a false expectation - they will be bought on 24 Dec as anyone would see with this rule (assuming the market is not crypto).
Hi guys, thank you for your replies. I simplified the strategy as much as possible in order to show the effect:
On image "f3.jpg" the positions are shown, there is one trade
108 x GILD 23/12/24 - 24/12/24
However, the 23 December 24 is a Monday, so the signal date would be 20 December 24 and the condition not fulfilled. Still the shares get bought.
On picture "f1.jpg" you see the strategy, on image "f2.jpg" the simpified strategy which still has the issue.
Kind regards,
Werner
I see what you mean by that one. The code for the Block is using some unorthodox DayOfYear comparisons. And since 2024 was a leap year the comparison it's using is broken. I'm flagging this for a fix for the next build.
thank you!
It's now fixed in WL9 Build 5 and PowerPack Build 2 for WL9.
Your Response
Post
Edit Post
Login is required