Announcement

Collapse
No announcement yet.

Backtesting with an external spread

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Backtesting with an external spread

    I am trying to trade a stock based on the RSI of an external spread. Basically, I short if the RSI of the spread is over 70 and go long below 30. All this between 9:32 and 9:37. Then I close the trades when the same RSI trigs on the other side.
    The RSI does not seem to trigger well. If I use the RSI of the stock, the EFS works so it seems to have something to do with the definition of the spread RSI. I do the following.
    if(studyx == null) studyx = rsi(10, sym("3 * XOM - ( USO + SPY ),50"));
    I honestly dont really understand the 50.
    I'm trying to use a RSI(10) of the spread on 20 days of minutes data.
    An example of a bad trigger is today, july 22 2008. The system short at 9:33 as it should but it does not cover @ 11:07 when the RSI cross below 30. I've also seen some missed triggers for opening trades.
    Any idea someone. The file is attached.
    Attached Files

  • #2
    Hi Keops?
    You don't say clearly what periodicity you are using for the chart, but by "minutes" maybe you mean "1 minute"?

    The "...,50", means the spread data is calculated using an interval of 50 minutes (as if you changed the chart to 50 mins). This will of course affect the RSI.

    Not sure if this is what you want, but just changing ",50" to ",1" maybe what you need. However, as there seems to be a problem with the amount of historic data that 10.1.1057 downloads for efs you may not see the bars at the day start in the historic bars. Don't you get affected badly by opening gaps, or maybe that is the point?

    Also, in preMain, changing the setPriceStudy() to false makes for a more conventional display (if the chart is open, you have to remove and reselect the efs, a Reload won't see that change).

    Comment


    • #3
      Hey Dave,
      it is exactly what I want to do. I want to use the one minute external spread one a one minute stock chart.
      I can make this thing work on one day of minute bars. I can't make it work on more than one day! Is it too overkill a calculation for esignal to handle? I have a Centrino duo core 1.83 GHz with 1 gig of RAM. The process Winsig just seems to disapear in the Windows task manager. The processor does not seem to get overloaded but the RAM is loaded before I start the process but I dont see why this could be an issue.
      Without the external spread I can go up to 200 days of backtesting with the 1 minute bars.
      Anybody have an experience of external spread crashing/overloading the backtest?
      Can anybody run the attached file on more than one day of 1 minute bars, symbol XOM?
      Attached Files

      Comment


      • #4
        Originally posted by Dave180
        Don't you get affected badly by opening gaps, or maybe that is the point?
        I dont know yet and that is why I want to crunch the numbers. Obviously there is a possibility that the spreads are wide at the open. It's why I start at 9:32, a time where the NYSE open print is usually done on XOM. Remember, where there is risk there is opportunity. It could lead at a semi-automatic system where the system trigs and you have to place the orders to make sure you get a decent price.

        Comment


        • #5
          Hi
          About the lack of historic bars in the indicator pane, read my post and see if that makes sense, it would seem there is a backfill bug, but you might be able to work around it - for instance you could try cycling through all the symbols used in the spread as the main chart symbol, that might force the backfill (worked for me on a dynamic chart, didn't try a fixed bar count).

          Or / If not, to help you see what is going on, you may want to create some dummy indicators that just plot the close of the symbols referenced in the spread, then you can see which symbols have been backfilled and which haven't.

          Comment

          Working...
          X