Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    A little advice....please.

    General Discussion
    2
    2
    663
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mkdvs last edited by

      I have managed to cobble together a python script that takes the Quandl WIKI export (1.7Gb) and reduces it down to 10 long buys and 10 short sales for each month. Enter the positions at beginning of the month, exit at the end...repeat. So, the .csv would look like (I'll include a few random stocks to illustrate):

      date        ticker        ls
      10/1/2000     AAPL       long
      10/1/2000     JNJ        long
      10/1/2000     MSF        long
      10/1/2000     NRG        long
      10/1/2000     A          long
      10/1/2000     OMI        short
      10/1/2000     CELG       short
      10/1/2000     ABBV       short
      10/1/2000     KMX        short
      10/1/2000     CSCO       short
      11/1/2000     SYMC       long
      11/1/2000     QCOM       long
      11/1/2000     PFG        long
      11/1/2000     LUK        long
      11/1/2000     EXPE       long
      11/1/2000     DLTR       short
      11/1/2000     STZ        short
      11/1/2000     COST       short
      11/1/2000     DVN        short
      11/1/2000     CSCO       short
      ...etc, etc....
      

      I am looking for some guidance on how to feed these in to backtest or, if it exists, another method of testing this as an equal weight portfolio. Since the table is a result of an algorithm, I need a way to backtest it as a dynamic, monthly portfolio. It is a challenge since the triggers are in the screening process. I would prefer to build the strategy in backtest but do not understand it well enough yet. Maybe contract someone to do it so the framework would be there then learn from that?

      I think I was attempting to turn backtest into a giant stock screener and that is part of the problem.

      Thanks for any input. So close yet so far away!

      1 Reply Last reply Reply Quote 0
      • P
        Paska Houso last edited by

        Probably related to the answer to this post a couple of days ago: https://community.backtrader.com/topic/678/manual-order-execution-trigger/3.

        There is a post on how to automatically trigger orders at a given price for historical performance evaluation.

        • https://www.backtrader.com/blog/posts/2017-07-05-order-history/order-history.html
        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }