A programmable trading plan using only price bars

Further update on the entry criteria with reference to trend:

We'll consider a long swing trade when either of the following is true:
- The 15-period triangular moving average is not-declining. If it is flat, its last direction was up.
- The 15-period triangular moving average is declining, but it was up no more than 5 bars back, and we have a swing low, some part of whose range is in common with the previous swing low.

The rationale is: Although we'd like to see a higher low, there are plenty of cases where a slightly lower low achieves the same effect. (idea stolen from Dunnigan)
 
Last edited:
Forgot to write before:
Maximum risk
- Those trades where the entry point is above the last swing high are not taken.
Edit:
- Those trades where the maximum risk is more than 2xATR(390), the average being taken over the previous day's data, are not taken.
 
Last edited:
Well on backtesting my trading plan I found some major flaws.

On some days where the market had some good moves, my plan ended up losing. Even if I discard a few days' action as too small a sample, this doesn't feel right. Surely a plan that intends to trade pullbacks in trends ought to do well on trending days!

My system expects too much from the market and unless every box is ticked, which is unlikely to happen every day, it will lose money.

My current thinking is in the following line:

1. It is unlikely that (with my level of understanding of the market) I'd be able to define a system with a high percentage of winners as well as having a decent average profit to average loss ratio. I therefore have to focus on setups that give around 50% winning trades with an average profit to average loss ratio of 2 or more.

2. This means when I lose, which would be often, the losses must be small, and when I win, I must win big. This means only one thing: instead of entering with the fully loaded position and then covering, the first entry should be light and more positions should be added as the market moves in my favour.

3. Which leads us nicely to the point of reversal versas pullback trades. I am entering first with a small position. So, if there is a trend, I must always jump on it and exit only when either the trend ends as per my definition or if I am proved wrong (i.e. when my definition says there is no trend after all). So in a nutshell, forget reversal vs pullback: if there is an uptrend then buy and if there is a downtrend then sell.

I have done some more research and programming over the last couple of days and managed to knock up a decentish short-term trend definition. I have managed to colour the bars, so it would make the decision process completely mechanical, should this stand up to testing.

Finally, after my setbacks with the other plan, which is incidentally very dear to my heart (for some reasons), I thought of not writing the journal any more. I thought I'd look like a pillock to everyone. But then I decided that it's my journal and I must confront my fears of looking like an idiot. Last thing I need is to worry about what people might or might not think of me. My job here is to get what I want. After all if it was that easy...

Below are some pictures of the bar colouring mechanism in action. It looks alright, although there are some whipsaws, which I guess will always be there.

I intend to backtest it using eSignal's strategy testing facility, as soon as I manage to understand how to work the damn thing. Here are charts for ES 1min, 3min and daily.
 

Attachments

  • 1.GIF
    1.GIF
    16.6 KB · Views: 256
  • 3.GIF
    3.GIF
    18.1 KB · Views: 249
  • Daily.GIF
    Daily.GIF
    23.5 KB · Views: 261
Last edited:
Questions to people who have backtested and implemented profitable strategies:
Is there any literature on approaches to optimising parameters and when to stop optimising?
 
Questions to people who have backtested and implemented profitable strategies:
Is there any literature on approaches to optimising parameters and when to stop optimising?

Forward testing solves that one.

I try and see what happens by widening the parameters to extremes. I feel that for a strategy to work it should work even if say the top 10% of trades never took place. If it does still work then its robust, and that is I feel the key word.

For example. I have a hard stop of 7,8.9.10 roughly.....however it works reasonably well down to 3 and works OK at 100!!. But its commonsense to look for a stop that takes out the majority of poor trades. Taking profits.....what happens at different point values, to your overall profitability. If you are looking at a very mechanical approach this is quite key and took me a while to realise. You definatly need to know how /when you are taking profits. What happens if your entry is a bar/time period later....testing this may surprise you.

The other consideration is.....If on a bad day eveything possible went wrong...what would be the bottom line. You need to prepare for that.....thats important to make your trading comfortable.
 
Hello and thanks for such an interesting thread.

I have just read the Way of the Turtle about the famous Turtles experiment in the 80's. It seems like a really simple system; the key seems to be taking all emotion from the trade and becoming almost mechanical, only entering and exiting on the given signals of the plan. The top turtle said he beat the others because he stuck to the plan rigidly whereas the other traded 'emotionally'

I'm looking for a way of adopting their risk management plan. He would enter with 1N (N=ATR of past 20 days x 1% of account balance)
He would then add N intervals if the trade went in his intended direction up to a maximum of ?N in whatever market he was trading.

I have been spreadbetting over here in the UK and I'm beginning to wonder if CFD trading is better and easier to manage? CFDs are liable for tax though!

I'm looking for a cheap easy to use platform that allows me to back test and enter a trade plan with ease; IGINDEX uses ProCharts but I find them hard to programme. Is there an easier to use platform that one can trade from Intraday etc that doesn't cost the earth?
Regards
Weasel
 
Trading plan v2.0:

Timeframe: 1 minute
Market ES.

Entry
When a green bar appears and the next bar breaks the high of that bar, close all shorts and enter long.
When a red bar appears and the next bar breaks the low of that bar, close all shorts and enter long.

Adding positions
Add one unit on every half ATR(390) advance (idea nicked from the Turtles), until we have a maximum of 4 open units.

Management
For long entries, place the initial stop one tick below the last red bar.
For short entries, place the initial stop one tick above the last green bar.

As things stand today, there is no plan to trail a stop. Trades are closed and reversed when a reversal signal appears (or the initial stop-loss gets hit).

The requirement of a H/L break in the entry condition will avoid some (many?) whipsaws.

I have managed to porgram the entry and exit conditions on eSignal Strategy Analyser. Still gotta program the bits around adding positions and the initial stop-loss.
 
Questions to people who have backtested and implemented profitable strategies:
Is there any literature on approaches to optimising parameters and when to stop optimising?

robert pardo, title is something like testing and optimization of trading systems. good for starters
 
There are two other areas in the system I'd like to enhance, while remaining conscious not to make too complicated again.
1. Once the trade reaches a certain target, a small part of of the position should be closed. I have not yet decided if the stop for the rest should be moved to breakeven or left unchanged.
2. I have to explore if synchronising the bar colours (e.g. long when 3min is green and 1min changes from red to green) with a higher timeframe improves the strike rate.
 
Trading plan v2.1:

Timeframe: 1 minute and 3 minutes
Market: ES.

Entry
The 3 minute chart should have a green bar. When a green bar also appears on the 1 minute chart and, enter long on break of the high of that bar.
The 3 minute chart should have a red bar. When a red bar also appears on the 1 minute chart and, enter short on break of the high of that bar.

Adding positions
Add one unit on every half ATR(390) advance, until we have a maximum of 3 open units.

Management
For long entries, place the initial stop one tick below the last red bar on the 1 minute chart. If a red bar appears, tighten the stop to one tick below that bar.
For short entries, place the initial stop one tick above the last green bar on the 1 minute chart. If a green bar appears, tighten the stop to one tick above that bar.

The requirements of a) trading with the 3min chart and b) taking entries on break of the H/L should greatly reduce whipsaws.
 
This is the result from today's pre-lunch session.
Trade no. Entry Exit P/L
L1 1273 1287.5 14.5
L2 1294.25 1289 -5.25
L3 1293.25 1304.5 11.25
L4 1307.75 1317.75 10
S1 1312.75 1306.25 6.5
S2 1305.75 1307 -1.25
L5 1309.25 1308 -1.25

Long entries are green lines, short entries are red lines. Coverings are blue lines.

All trades are taken using the v2.1 of the plan, except no position was added to winning trades. I haven't tested for the rest of the day simply because I am in a hurry now and this manual backtesting business is quite tiring, especially after a long day at work.

OK, it was an easy day today and also the market did get a bit choppy around lunchtime, but by not testing the rest of the day I have also missed out on the two nice moves in the last hour.
 

Attachments

  • Untitled.PNG
    Untitled.PNG
    37.9 KB · Views: 261
Last edited:
Very strange. It seems YM currently offers more opportunity of making money than ES or NQ.

If I calculate last daily price divided by 15 day ATR divided by contract multiplier (5, 50 and 20 respectively) then YM comes up with the highest value. I call this value the normalised travel measure. It lets you compare how much different markets 'travel'.

Somehow I always thought ES offers the best bang for one's bucks.
 
Very strange. It seems YM currently offers more opportunity of making money than ES or NQ.

If I calculate last daily price divided by 15 day ATR divided by contract multiplier (5, 50 and 20 respectively) then YM comes up with the highest value. I call this value the normalised travel measure. It lets you compare how much different markets 'travel'.

Somehow I always thought ES offers the best bang for one's bucks.

Perhaps thinking in terms of which market offers the least risk is more appropriate...

(btw, I think the ER2 weighs the highest - relavite to ES/NQ).
 
I am going to start paper trading very soon. Backtesting with the current trading plan has been encouraging. I have backtested manually because programming a backtest in eSignal is becoming a pain on the backside.

I have also now realised that when the market is choppy, the vast majority of otherwise good and profitable trading systems will lose money, so I shouldn't really be worrying about that. Instead, my focus should entirely be to trade the hell out of a good market and lose as little as possible in a bad market.

My earlier trading plan was losing money in a trending market, where it's supposed to trade !

Also, as I intend to use the exact same trading plan for EOD futures trading as well (eventually), the effect of choppy markets on different timeframes should negate each other. In other words, a market cannot be choppy in 1min, 3 min and daily chart all at the same time. When the daily is choppy, there will be almost certainly huge moves on lower timeframes and vice versa. By the same logic, if intra-day market conditions become dramatically difficult, I can always switch from 1min-3min timeframes, to for example, a 5min-15min, or to a 10min-30min system, while still following the exact same trading setups. So I am quite comforatble with the whole thing.

One change in paper trading is that I intend to trade SPY instead of ES. At present I have a cheap but delayed eSignal feed, but realtime future feeds are expensive with the daylight robbery that's called 'exchange fees'. Even the YM level 1 feed which used to be free is now about $50. I need to keep my costs down while practising. There should be very little difference, if any, between the ETFs and their futures counterparts.
 
I have a serious issue.

I somehow have it in my head that to trade profitably I must have 80-90% winners. The moment my system has 5 losses in a row, or a losing day, I lose my nerve and ditch the system. I have done this many time in the past and was tempted to do this again last week. No system will cure this disease unless I stand up and take responsbility.

I must at all times remember:

1. Losses are inevitable.

2. Traders who have a high win rate have so because of their market reading, which I don't have and most probably will never have.

3. If I want a programmable strategy, which I do, I must accept that the win rate will never be anywhere near that of a good trader.

4. What I need to worry about is not whether my strategy makes money everyday (which it won't), but whether I am net positive at the end of the month (which it should).

5. Except for those traders with a lot of market insight (which usually cannot be taught or transferred), the vast majority of otherwise profitable traders who focus on 1 or 2 markets only, as opposed to trading different markets every day would struggle to make money on choppy days. That's the cost of trading a fixed set of markets everyday. Get used to it.

6. Any strategy that follows the currently prevailing trend from a point not too far from its inception or recurrence, and has a decent management process in place, will be net profitable. Not everyday, but in the long run. Also, none of the losing days will be wipeouts, the strategy should simply win small amounts, lose a little more and should end up a net loser by a small amount that day. Incidentally, none of this is difficult. There are so many free strategies around on the Internet which one could literally lift and make profitable that it's a real pity that we keep going round this circle of confusion.

7. Any mechanical system will almost certainly buy the last pullback or breakout before the top (potentially making a loss) and sell the last pullback or breakout before the bottom (potentially making another loss). No way to avoid it other than adding trader discretion, which I am not prepared to do. Get used to it.

In short I need to manage my own expectation. I need to wake up from this dream of becoming a trading hotshot and instead just focus on having net positive months.
 
Last edited:
Top