What do you guys use to backtest a strategy?

Discussion in 'Technical Analysis' started by Jayan16118, Mar 16, 2019.

  1. MattZ

    MattZ Sponsor

    Good to know. We have requests for Java once in a while.
     
    #11     Mar 16, 2019
  2. Thanks everyone, this is extremely helpful. I'm very new to trading so could you give a quick step by step summary as to where you first get the data to then backtest your strategies? Am I right in thinking, it's all already within the backtest program? So for instance, if I want to look at all tickers from floats under $100m over the past 18 months that have a share price of $25> and the share price rose by 200% or more within any 7 day period before falling by at least 50% I just need to enter these parameters in the backtesting program? I don't need to import the data in from anywhere right? E.g. my broker platform?

    Thanks in advance! I'm eternally grateful to you all
     
    #12     Mar 16, 2019
  3. Felix168

    Felix168

    It seems I am late to the party... but that gives me the option to also answer your data question.

    Most backtesting platforms allow you to bring in data in multiple ways:
    • publicly available sources, e.g. Yahoo finance
    • commercial data providers, e.g. IQFeed/DTN or Norgate, sometimes re-branded and free under certain conditions
    • from your broker
    • from locally stored CSV files
    Typically, this is just price data. Fundamental data, like your criterion on float, are a bit of a different animal and often not easily accessible.

    What you are describing is a market scanner. Most platforms allow you to set up a scanner on your own, but it will require some manual work. These scanners typically provide a snapshot, and not a history, so using scanner results as a trading universe will require yet another manual step.

    FWIW, I am developing pretty much exclusively on TuringTrader. This is an open-source backtesting engine with some quite unique features, especially when it comes to more complex strategies and options: for more info see here https://www.turingtrader.org/


    Cheers, Felix
     
    #13     Mar 16, 2019
    beppe59it likes this.
  4. Thanks Felix! Very informative reply, so what would be the final manual step to get historic data according to my parameters, as you are right, scanners only give a real time scan of the market and not historic so where would I go for that info?
     
    #14     Mar 16, 2019
  5. Felix168

    Felix168

    I would approach things as follows:
    • create a coarse universe, which should include all stocks you might be interested in
    • make sure you have all the data available. Price shouldn't be your biggest issue, fundamentals might be more complicated. Possibly, you can use a criterion that is derived from daily traded dollars, as the product of volume and price instead?
    • run a simulation, taking note of every stock meeting your criteria, and the resulting time frames of interest. Dump this list at the end of the simulation.
    • run more simulations, using the information created in the step before
    Hope this helps,
    Cheers,

    Felix
     
    #15     Mar 16, 2019
  6. %%
    investors.com
    barchart.com.
     
    #16     Mar 17, 2019
  7. Thanks for your reply Felix, but I'm trying to find all stocks which meet my parameters, so I don't know the tickers I'm interested as that's what I'm trying to find out

    Is there anyway you know of to find this out? Basically I want to do a historic equity feed type scan, there must be a program out there that can do this?
     
    #17     Mar 17, 2019
  8. Felix168

    Felix168

    Well, it's probably not practical to search 'everything', and I have no idea how you would even implement that. So, I believe you will still want to start with a given coarse universe, containing all those instruments you might be even remotely interested in. As an example, you could start with the S&P SmallCap 600 constituents, and then filter that according to your requirements. Makes sense?

    Cheers, Felix
     
    #18     Mar 17, 2019
  9. kj5159

    kj5159

    Sounds like you would need a list of tickers first, maybe run a screen for stocks with < $200-300 million float and other results of the ideal end factors that you listed, so for $25 stock price search for $75 stock price etc., to account for the gains you describe then get historical data for those tickers then feed that list through some kind of filtration system, maybe Excel or a program you can write if you know how to do that, and off you go.

    I've been wondering about this exact question myself and the best I've been able to come up with is to cobble the pieces together manually. There has to be some kind of software that can do this, I haven't done a lot of looking yet but that iMaxProfit software that recently started advertising on here MAY be able to do it, though I have no clue.
     
    #19     Mar 17, 2019
  10. Quantopian and Python. By far the best and most flexible tool I have used to test ideas. Before that I used TradeStation.
     
    #20     Mar 17, 2019
    d08 likes this.