An Interactive Backtesting Development Example

Discussion in 'Strategy Development' started by Argent, Aug 16, 2011.

  1. Argent

    Argent

    For any who are interested, I will go through the process of developing a backtest using my existing eSignal code. I will not spoonfeed. If you want to participate, it must be interactively. To begin, please look at the following structure and ask any questions about it you like. Following that we will build up code for an example of my choosing that I know functions correctly. I believe that eSignal's language is sufficiently simple that anyone here can follow it.

    //system backtest structure
    //variable declarations
    //function declarations
    //set up chart parameters
    //backtesting code
    {
    //determine the time
    //initialize variables
    //establish trade day validity
    //test for time window
    {
    //trade loop
    {
    //set up trade entry conditions
    //entry code
    //stop loss code
    //profit stop code
    //end of day exit code
    //profit calculation and "helper" code
    }
    }
    }
     
  2. Do you really have time for that stuff? I mean what you do is fine but who casres about eSignal anyway and who has time doing code?

    Machine generated startegies hand you the code so you can just plug it in. Do you know anyone who manufactures a car just to go out for a ride?
     
  3. Argent

    Argent

    I reveal my total ignorance of what you are recommending by asking what the startup and maintenance costs are to obtain that capability.
     
  4. Anywhere from 60+ K to 3K. The system I have generates full code for TS and Wealth Lab and logic-only type of a thing for Amibroker and other platforms but I have developed some templates to fit it in and just do copy and paste.

    There are other systems I have not tested. Safir-X and Trading System Lab are two of them for example. I tested some others and they just took too long or the results were fitted or random systems.

    I mean backtesting yourself is like developing a program using CPU language rather than using a high level language.
     
  5. Argent

    Argent

    I'll defend my Stone Age method later. How many hundreds or thousands of hours did it take you to become proficient to your satisfaction?
     
  6. Argent

    Argent

    That's impressive. When initializing the program do you have to specify things like the bar period (like one minute), the maximum duration of the pattern to search for (like 10 bars), the price sensitivity of the pattern detection (like 2 ticks or 2 cents), predefined S/R (like a fib), and whether or not to use volume?
     
  7. Argent

    Argent

    Stone Age defense:

    I am not getting how backtesting is so complicated. In eSignal you create a chart with the bar interval you want, say one minute. Then you create and apply a time template for the interval during the day you want to chart, say 9AM to 4PM Eastern, and the number of days to chart. The eSignal program handles the backtesting iteration through that number of days over that interval. You have to rite the code that describes what trade actions to take under hat chart conditions. To repeat the structure I use:

    //system backtest structure
    //variable declarations
    //function declarations
    //set up chart parameters
    //backtesting code
    {
    //determine the time
    //initialize variables
    //establish trade day validity
    //test for time window
    {
    //trade loop
    {
    //set up trade entry conditions
    //entry code
    //stop loss code
    //profit stop code
    //end of day exit code
    //profit calculation and "helper" code
    }
    }
    }

    Once this basic structure is coded the only thing you have to change from strategy to strategy is the "set up trade entry conditions" part. This may be as little as two lines of code and rarely more than maybe ten.

    So for example if I want to test the hypothesis that an intraday retrace to the open is a tradeable event, I write really simple code that describes the retrace and plug it into the structure.
     
  8. Do you understand what Bill is doing conceptually? I'm not asking to be condescending, I just want to throw out there that he's mining for patterns and *not testing conceptual ideas*. Big difference here.

    This is one of the reasons he might get offended if you mention pirates, or, question his ability to sift dirt from gold. Just an FYI.
     
  9. Argent

    Argent

    And I thought I was cleverly sucking him in to admitting that! Pretend that he doesn't understand the difference and desplain it to me. As soon as I saw one of his links that said "161 patterns found" he lost me. I would still like to understand how it works, though. It is no fun at all being old and hidebound and neophobic. Homophobic is bad enough. And what be pirates, aargh!, that he be afeard?
     
    #10     Aug 16, 2011