Bella

Stock price issue

Programming


Hi team, I found that the price for 06689HK looks strange. 
From the console, the price level is around 90.0 before 2023-01-06, but it studdenly drops to the level of 30 after that. 
However, when I cross check the price chart from other websites, this stock never reached the price level 90 before. The highest should be around 40. Seems it is a data issue? 



 
Jonathan Tay

Hi Bella,

 

To directly answer your question, there was a 3:1 stock split that happened which is why the price dropped by that ratio from 9th Jan 2023.

 

The reason why you cannot see the price difference some other websites is because they apply the ratio to edit historical prices make the chart smoother, rather than have a sudden drop from 90 to 30.

 

The issue on ALGOGENE is that the position data is not handled correctly to take into account the corporate action.

For example if you bought 100 shares at $90 (value $9,000) on 6th Jan, your position on 9th Jan should be 300 shares (value $10,380 calculated using $34.6/share), rather than 100 shares at $34.6 (value $3,460)

 

The corresponding handling should be applied should you have been short as well such that all position types can be accounted for.

 

I suggest avoiding all stocks that have corporate action for the purpose of backtesting as it is currently not being handled correctly on the platform.

 
admin
Hi Bella, below is the screen captured from Yahoo Finance for better explanation. 
For 06689HK, there was a 3:1 stock split event on 6-Jan-2023. 
 
In fact, for many data sources available online like Yahoo Finance, the data is backward adjusted. 
eg. Yahoo Finance's closing price on 5-Jan-2023 shows 30. But in reality, what you actually observed in the market on that day would be 30*3 = 90 (match with the figure you capture from our system). 

If you have outstanding position (eg. 100 shares) before the split, our system will automatically adjust your position on the split date (i.e. 3*100 = 300 shares). 

It is our system design to simulate the market environment that you will observe when deploying the script to a real broker account. 


 
Bella
Original Posted by - b'Jonathan Tay':

Hi Bella,

 

To directly answer your question, there was a 3:1 stock split that happened which is why the price dropped by that ratio from 9th Jan 2023.

 

The reason why you cannot see the price difference some other websites is because they apply the ratio to edit historical prices make the chart smoother, rather than have a sudden drop from 90 to 30.

 

The issue on ALGOGENE is that the position data is not handled correctly to take into account the corporate action.

For example if you bought 100 shares at $90 (value $9,000) on 6th Jan, your position on 9th Jan should be 300 shares (value $10,380 calculated using $34.6/share), rather than 100 shares at $34.6 (value $3,460)

 

The corresponding handling should be applied should you have been short as well such that all position types can be accounted for.

 

I suggest avoiding all stocks that have corporate action for the purpose of backtesting as it is currently not being handled correctly on the platform.

I see, got it now. 
I will avoid backtesting on these kind of stocks. 
Thank you for your prompt reply. 👍