Can we detect splits, divideds, bonus, and other price adjustments through python?

algotrader29
Say my algorithm have given a BUY signal

shareX bought at Rs289 with target Rs 315 CNC order.

Next day it goes Face Value Split from Rs10/- -> Rs2/- per share. its now trading in the range Rs 40-60.

1. Can we detect face value split through the python API/Historical?
2. How do we calculate the new target?
  • Matti
    @algotrader29 The Kite Connect is merely an execution platform. The corporate actions will need to be factored in on your end. The historical data is adjusted for corporate actions at the end of each week.
  • algotrader29
    @Nikhil.A Thanks for reply. I understand that we have to factor corporate decisions on our end.

    I have 2 specific questions. I am new to this so sorry if my questions are very basic.

    1. The yahoo historical api provide Stock Split/other price adjustment information

    ref: http://luminouslogic.com/how-to-normalize-historical-data-for-splits-dividends-etc.htm

    unfortunately this doesnot support NSE stocks.

    After we detect we can use algorithm at our end to factor that change[split/reverse split etc]

    Q - so is there any way we can find the same if there have been a split/dividend/priceadjustment by Zerodha python API if we provide a date range?

    2. As you mentioned 'The historical data is adjusted for corporate actions at the end of each week.'

    e.g NSE/COMPINFO have gone face value split (from Rs10/- -> Rs2/- per share) on 16-Feb-2017. prior this split date it was trading at Rs ~300 now after split its trading at Rs~50.

    Q - so if we call the price of Compinfo before 16-Feb-2017 on historical api for this above scenario will we get the actual price as on that date i.e ~Rs 300 or we will get new adjusted price. Please note I am asking for the price as on 16th and before. Will the historical price be adjusted as per the latest corporate actions?
  • Matti
    is there any way we can find the same if there have been a split/dividend/priceadjustment by Zerodha python API if we provide a date range?
    You'd not be able to see a flag or such that there has been a corporate action, however, if you're storing historical data, you'll see that there's a difference (corporate action adjustment) and so should be able to determine that there's been a corporate action.
    if we call the price of Compinfo before 16-Feb-2017 on historical api for this above scenario will we get the actual price as on that date i.e ~Rs 300 or we will get new adjusted price. Please note I am asking for the price as on 16th and before. Will the historical price be adjusted as per the latest corporate actions?
    Once the adjustment is applied by us, if you call the historical API, you'll get the adjusted price and not the actual stock price for any historical dates. This applies to data from 2012 onwards.
  • Matti
    @algotrader29 In addition to my earlier answer, we also maintain a list of upcoming corporate actions that you can check out here.
  • algotrader29
    @Nikhil.A Thanks a lot for all the clarifications it really helps out....

    You guys are really breaking barriers other interactive brokers, atleast in India cannot compete in price or innovation at this point...

    I would request you and team to review this as a feature request

    something like

    Kite.priceadjustments('SymbolName', StartDate, EndDate)

    This would return a python dict with all the corporate actions have the symbol have gone through in between the range and return the factors as well say Split[3:2] , bonus value dividend etc

    if any date is > todays date then that is 'Upcoming'

    As we all are algotrading here an API would be great help

    cheers!
  • Matti
    @algotrader29 Interesting suggestion. We'll take it under advisement. :) Right now, we're working on revamping the core APIs, so it'll take us a little time before we incorporate any more requests.
Sign In or Register to comment.