Short term S&R system

Discussion in 'Automated Trading' started by IndexSwing, Dec 23, 2008.

  1. As I have said in previous threads I am programming illiterate and so I'm not able on my own to test automated systems. But the thought occurred to me that the support and resistance system described here
    might also work well as a day trading system where n represents a certain number of minutes instead of days and might work well across various futures contracts. If anyone would like to do some testing and share results I would appreciate it.
  2. This type of system does work on an intraday basis, I know by experience.

    The main drawback is that choosing a fixed number of bars to calculate HH and LL does not give the system any sensitivity to changes in volatility. The main advantage is that it is very easy to program.

    Again, over time I have found the system to be profitable, but it's not without its drawdowns. IMO a better approach would be to look at price levels for support and resistance, rather than a concrete window of bars to define these levels. It makes the definition less "arbitrary" because of price-sensitivity, not time-sensitivity.

  3. That makes sense. Thank you RT.
  4. I built this Time-based SR indicator, and plugged it into my proprietary trading system framework.

    The basic code of the setup is this:

    Define N as the number of lookback bars to determine the highest High, and lowest Low.

    Define BarCounter as:

    - 1 if first bar of session
    - BarCounter[1] + 1 all other bars.

    BarCounter is simply a variable that accumulates in incrememnts of 1, being reset to 1 at the first bar of each session.

    Then, if BarCounter < N,
    R_Level is the highest high of the past BarCounter bars
    S_Level is the lowest low of the past BarCounter bars

    if BarCounter >= N,
    R_Level is the highest high of the past N bars
    S_Level is the lowest low of the past N bars

    To be continued....
  5. Now to define the setup:

    At the first bar of the session, set variable Setup = 0

    If BarCounter >= N, then:

    - If the high of the current bar is greater than the R_Level of the previous bar, then Setup = 1

    - If the low of the current bar is less than the S_Level of the previous bar, then Setup = -1;

    The basic idea is to initialize Setup to 0 at the beginning of each session. Through the remainder of the session, Setup will move back and forth between +1 and -1 to indicate the direction we want to trade.

    Now to define my trade management:

    The direction of the trade always follows the sign of Setup, but I won't discuss my entry as that is a critical component of the "edge" I use. The core idea here is to demonstrate that 1) setup and entry should be designed separately, and
    2) simple setups can yield consistently profitable systems as long as other components, such as proper entry design and trade management, are present.

    Once a trade is entered, I use 4 targets, each integer multiples of a fixed number of ticks. The number of ticks doesn't need to be optimized, as I have found good stability and profitability over a wide range of values. It is more of a psychological issue, whether the trader needs to feel reassured by consistent profit-taking. One could not even use any targets and simply stay in the market until the setup becomes invalid.

    If setup reverses sign, then the system will attempt to reverse the position by establishing the same type of entry, however in the opposite direction.

    Trading times are between 9:30 and 16:00 EST, and the system will liquidate all positions at market at exactly 16:00 EST.

    To be continued....
  6. Trade results:

    For daytrading systems, many performance summaries examine trade-by-trade results. I don't think this is a valid way to do it.

    Account balances are typically marked-to-market on a daily basis (mutual funds are a good example), so it makes sense to calculate perfomance metrics using session PNLs, rather than individual trade PNLs. Furthermore, my daytrading systems are always in the market from the first trade until the end of the day, where the system sidelines the account. Hence, daily accounting of PNL makes perfect sense just in this respect.

    I use three trade metrics: Total Net Profit, Session expectancy, and session Profit Factor.

    For the ES, I use $2.40 per side per contract for commision, and 1 tick slippage, for trading conditions.

    I used a 1-minute ES chart, from 12/26/2006 - 12/24/2008 (24 months), and optimized to find N = 20 to be a good balance point. By Default, I use 24 target ticks (6 pts.), so the first target is 6 pts, second is 12 pts, third is 18 pts, and fourth is 24 pts. I do not use a stop, because a reversed setup will take me into a trade into the opposite direction.

    The equity curve (daily) is attached.

  7. To illustrate the robustness of a simple setup, with proper entry and trade management, I have swept N from 12 to 32 in increments of 2, and attached the equity return curves for each value.

    Please see attached.

  8. This looks like you are buying high and selling low all the time. My intuition tells me that this would be a losing system, with a lot of whipsaws, especially in the range-bound markets. However, I'll code it and report my results here.
  9. Rough, Have you traded the system cash? If so, were there unexpected variables that affected results? I think this system's strength lies in the set targets. I am more and more thinking that even a random entry utilizing stops would be profitable, if increasing fixed targets are used. Eventually a trend will happen and you will be in it, and no one knows how long they will last. However, most traders do not ride the winners.
  10. The performance is really dependent on the entry. This is a trading system based on a rather crude definition of support and resistance, but still makes money because the entries I choose can still produce a relatively decent equity curve in spite of the mediocre setup.

    The multiple targets are always fixed - hence the reason for multiple targets. We never know what kind of volatility is around the corner, nor how long trends will last. The taking of partial profits enhances trade efficiency, by not allowing running winners collapse on themselves without taking at least SOME money from the trade. The target levels you choose are based on personal comfort. The reason, I've found, is that for a well-working strategy, smaller target values increase the probability of winning trades (i.e. %winners), but also decrease profitability per trade, so the trade expectancy is not first-order sensitive to this variable. I personally hate to see strings of losing trades, so reasonable target levels help puncture the losses from whipsaw trades.

    With the entry algorithm I have developed, you could dramatically transform the performance of even a moving average cross-over system. This kind of system will never be flawless, obviously, but careful design of the entry can filter a lot of whipsaw trades to a certain extent.

    The main point is, thre are a lot of simple setups that are profitable, but to unlock that profitability, the entry must be carefully considered.

    #10     Dec 30, 2008