Algowizard.io/ AlpacaAPI/ wrong prices in Before Bar Open entries - Important Bug

 

I found an important bug comparing the logs SQX vs. AW.

 

1. The bug exists in all strategies that are using the On bar open entry I have checked. It is on the AW server, I'm using Alpaca API.

 

2. In the strategy and server log I see that the strategy should use yesterday's prices [0] but in reality, it is using day-before prices [1]. See screens.

 

3. The problem exists in any ticker I checked in the log.

 

4. The problem affects also the real trading of your sample Mean Reversion strategy.

 

5. I made detailed tests also of "On bar open" entries and there is no such problem, this mode is using proper prices in the cases I've tested.

 

I'm waiting for a quick reaction :)

Attachments
LogCase1_Meanreversion.txt
(211.23 KiB)
Case2_1Day.png
(111.64 KiB)
BeforeBarOpenRules.png
(486.63 KiB)
Case1_1Day.png
(114.11 KiB)
Case1_Log.png
(627.45 KiB)
Case2_0Day.png
(113.94 KiB)
Case2Log.png
(18.78 KiB)
MeanReversion_10.sqx
(1.50 MiB)
Case1_0Day.png
(111.40 KiB)
  • Votes 0
  • Project AlgoWizard
  • Type Bug
  • Status Fixed
  • Priority Normal

History

m
#1

Michal

26.01.2023 12:08

Task created

TB
#2

Tomas Brynda

26.01.2023 15:13

Status changed from New to Fixed

Hi Michal,

you are absolutely right. We had a bug in allocating data for beforeBarOpen signals evaluation.


Thank you very much for letting us know and for your great description using charts.


The issue is fixed now. The change will take effect tomorrow.


Best regards,

Tomas

m
#3

Michal

26.01.2023 17:41
Hi Tomas, thanks for your so fast reaction! 
m
#4

Michal

07.02.2023 10:50

Attachment LogAW.png added

Attachment Scr1.png added

Attachment Scr2.png added

Attachment AWLog.txt added

Attachment SQX_Log.txt added

Attachment image-0.png added

AWLog.txt
(189.07 KiB)
Scr2.png
(510.38 KiB)
LogAW.png
(3.44 MiB)
SQX_Log.txt
(5.36 KiB)
image-0.png
(27.58 KiB)
Scr1.png
(482.38 KiB)
Hi Tomas,


Unfortunately, the problem still exists after 27.02.


1. Open [0] prices are working OK after your fix.

2. But eg. Low prices, instead of [1] are using [2].

3. My ATR is using [2] instead of [1] so I think it can be a problem of more indicators lookback. 


Please look at the new screens and logs. 

The strategy is using the same On Bar Open entry.

Best regards,

Michal


m
#5

Michal

07.02.2023 11:52

Attachment AW0102.png added

Attachment AW0202.png added

Attachment AW0302.png added

AW0102.png
(637.66 KiB)
AW0202.png
(604.15 KiB)
AW0302.png
(968.51 KiB)
Hmm, interesting. In another strategy, I check I see the problem occurred only on 02.02.2023 (I've checked a few days after 26.01).


Here are the log screens on the same ticker:

01.02 - OK

02.02 - Wrong Data

03.02 - OK


It seems like API didn't get valid data or did the problem occur on 02.02 and you fixed it?


Best regards,

Michal Zaremba

 




Votes: 0

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please