Is an excuted price the following opening price?



  • Hello. I'm working on Quickstart manual. The manual says that when the broker executes an order, it uses the opening price of the next bar.

    orcl-1995-2014
    Date,      Open, High, Low,  Close,  Volume, Adj Close
    2000-12-20,28.06,29.81,27.50,28.50,54440500, 26.88
    2000-12-21,27.81,30.25,27.31,29.50,46719700, 27.82
    2000-12-22,30.38,31.98,30.00,31.88,35568200, 30.06
    2000-12-26,31.50,32.19,30.00,30.94,20589500, 29.17
    2000-12-27,30.38,31.06,29.38,30.69,26437500, 28.94
    2000-12-28,30.56,31.62,30.38,31.06,25053600, 29.29
    2000-12-29,30.88,31.31,28.69,29.06,31702200, 27.41
    

    So, in my understanding, if an order is created on 20 Dec from the data above, the following execution price should be 27.81 on 21 Dec, however, this is the result:

    2000-12-20, Close, 26.88
    2000-12-20, BUY CREATE, 26.88
    2000-12-21, BUY EXECUTED, 26.23  -> ???
    2000-12-21, Close, 27.82
    2000-12-22, Close, 30.06
    2000-12-26, Close, 29.17
    2000-12-27, Close, 28.94
    2000-12-28, Close, 29.29
    2000-12-29, Close, 27.41
    2000-12-29, SELL CREATE, 27.41
    

    Please point me out my misunderstandings.


  • administrators

    @nullpy said in Is an excuted price the following opening price?:

    orcl-1995-2014
    Date,      Open, High, Low,  Close,  Volume, Adj Close
    2000-12-20,28.06,29.81,27.50,28.50,54440500, 26.88
    2000-12-21,27.81,30.25,27.31,29.50,46719700, 27.82
    2000-12-22,30.38,31.98,30.00,31.88,35568200, 30.06
    2000-12-26,31.50,32.19,30.00,30.94,20589500, 29.17
    2000-12-27,30.38,31.06,29.38,30.69,26437500, 28.94
    2000-12-28,30.56,31.62,30.38,31.06,25053600, 29.29
    2000-12-29,30.88,31.31,28.69,29.06,31702200, 27.41
    

    Those are raw unadjusted prices (dividends and others not applied). The adjusted prices are used. Instead of using the raw data in the file, use what the data stream provides you (because it will adjust the prices)



  • @backtrader
    Thank you for the answer! Could you tell me which *.py file does the work and what I should look at?


  • administrators

    feeds/yahoo.py

    Look for the use of adjclose (the already adjusted close) to adjust the other fields.



  • @backtrader
    I have found the option and how it converts the other fields. I appreciate your help!


  • administrators

    It is documented: Docs - Data Feeds Reference


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.