Jump to content

Andrew's Pitchfork Trading Strategy

Recommended Posts

Hi everyone, 

so, those of you following my FTSE - Daily Trades thread may know, I'm looking for new strategies to tackle the market.

Was starting to think about this today and made a few thoughts.

First one I came up with in the process is the following and utilises 'Andrew's Pitchfork' a rather odd name for a simple principle.

 

Thought Process
I was going back to the basics and starting to think about the fundamentals of trading: Buy low and sell high. Or go short high, and buy back low later.
So the key of my new strategy has to somewhat depended on these fundamental trading principles.

Next I was thinking, looking at a chart, in what region can the price considered to be "low" and in what region would I consider it to be "high".
I was looking at a 5min chart and looking at the whole day.
I was drawing one line at the low of day, one line at the high of day, those are obviously the extremes where everyone can agree prices are low / high.
Then I draw a line right in the middle between the two, where the price is neither high nor low.
Then I draw a line at 25% and one at 75% and said, if the price is between the low of day (0%) and 25%, I consider the price to be low. If the price is between 75% and high of day (100%) I consider the price to be high. In between (25%-75%), it's neither high nor low.
If I'd somehow manage to always buy in the low range and sell in the high range (or go short vice versa), then this could be a decent strategy.

The next problem I was facing is, I've done this analysis on the previous day, where we know high and low of day. How can this strategy work out for future price movements, where high and low of day are unknown.

Andrew's Pitchfork
This is where the Pitchfork comes in.
The assumption I'm making is that if I extrapolate the 4 required levels (low of day, high of day, 25% and 75%) from the previous day to the following day, the strategy still works. This is because more often than not, prices move up and down around a certain level, without breaking away from it and moving onto the next level. (This obviously has to be proven with data - more to that later)
The way the pitchfork works is exactly how the 4 required levels are drawn up. The pitchfork is defined over 3 points: High, Low and Mid-point. It then draws 5 levels on the chart: High (100%), 75%, Mid (50%), 25%, Low (0%)

So how does it work
The way I imagine it to work is the following:

1) Identify previous day's high and low

2) Draw the pitchfork in the chart with aligning its high and lows on the daily high and low. The mid point is exactly in the middle of daily high and low. This draws a horizontal pitchfork in the chart.

3) When the price of the asset falls below 25%, place a buy stop order at the 25% level. Once the price rises again and breaks through that level, the order gets executed. (vice versa with shorting above the 75% level)

4) Stop Loss is right below (size of the spread) the low of the pitchfork. Target is somewhere above 50%-75%. You have at least a 1:1 risk-to-reward ratio. Need to calculate target level by asset based on historic patterns.

Does it work?
Don't know yet. So far I've manually painted a few of those pitchforks in the chart for the past couple of days on FTSE100, NASDAQ, CL and NG and it seems it works more often than it doesn't.
Cases where it clearly doesn't work is when there's a strong move to either direction, aka price breaks-out and moves to a different level than it was the day before. Interestingly when this happens, the strategy wouldn't necessarily always result in a loss, but sometimes the entry conditions would never be triggered in the first place. E.g. if we start the day already in the high region (above 75%) and then never fall below it - no order triggered on that day.
On the negative side, huge breakout opportunities are missed with this strategy, so worth looking into a complementary strategy which works specifically for break-outs.

Next steps
Next, I'm trying to backtest the strategy. Will need to pull a whole lot of data and analyse. Hope to have that done over the weekend. Will update the thread accordingly.
Data I'm trying to get: Win ratio, Where's the optimum take profit level, Time of day where this usually plays out (my idea is to hook this in with the ATR analysis I've done and trade this pattern at times of high ATR, aka FTSE, DAX in the morning, NASDAQ, NG, CL in the afternoon) 

First success
First successful example trade taken this afternoon on CL.
You see nicely how the pitchfork is drawn on the chart and is derived by the high and low of the previous day.
At 14.30 today the price dipped below the 25% level. I set the buy stop order at the 25% level, which got triggered at 14.35. The price afterwards makes a sweep move up to the 50% level, where my limit sell order gets triggered at 15.15. It would've been possible to play it up until the 75% level, but wanted to be safe, without having the data yet.
Could've been luck - who knows.

 

What do you think of this approach?

 

image.thumb.png.3d38406536cc114b0fd420827cce8cd1.png

 

 

 

  • Like 2

Share this post


Link to post
4 hours ago, DSchenk said:

Hi everyone, 

so, those of you following my FTSE - Daily Trades thread may know, I'm looking for new strategies to tackle the market.

Was starting to think about this today and made a few thoughts.

First one I came up with in the process is the following and utilises 'Andrew's Pitchfork' a rather odd name for a simple principle.

 

Thought Process
I was going back to the basics and starting to think about the fundamentals of trading: Buy low and sell high. Or go short high, and buy back low later.
So the key of my new strategy has to somewhat depended on these fundamental trading principles.

Next I was thinking, looking at a chart, in what region can the price considered to be "low" and in what region would I consider it to be "high".
I was looking at a 5min chart and looking at the whole day.
I was drawing one line at the low of day, one line at the high of day, those are obviously the extremes where everyone can agree prices are low / high.
Then I draw a line right in the middle between the two, where the price is neither high nor low.
Then I draw a line at 25% and one at 75% and said, if the price is between the low of day (0%) and 25%, I consider the price to be low. If the price is between 75% and high of day (100%) I consider the price to be high. In between (25%-75%), it's neither high nor low.
If I'd somehow manage to always buy in the low range and sell in the high range (or go short vice versa), then this could be a decent strategy.

The next problem I was facing is, I've done this analysis on the previous day, where we know high and low of day. How can this strategy work out for future price movements, where high and low of day are unknown.

Andrew's Pitchfork
This is where the Pitchfork comes in.
The assumption I'm making is that if I extrapolate the 4 required levels (low of day, high of day, 25% and 75%) from the previous day to the following day, the strategy still works. This is because more often than not, prices move up and down around a certain level, without breaking away from it and moving onto the next level. (This obviously has to be proven with data - more to that later)
The way the pitchfork works is exactly how the 4 required levels are drawn up. The pitchfork is defined over 3 points: High, Low and Mid-point. It then draws 5 levels on the chart: High (100%), 75%, Mid (50%), 25%, Low (0%)

So how does it work
The way I imagine it to work is the following:

1) Identify previous day's high and low

2) Draw the pitchfork in the chart with aligning its high and lows on the daily high and low. The mid point is exactly in the middle of daily high and low. This draws a horizontal pitchfork in the chart.

3) When the price of the asset falls below 25%, place a buy stop order at the 25% level. Once the price rises again and breaks through that level, the order gets executed. (vice versa with shorting above the 75% level)

4) Stop Loss is right below (size of the spread) the low of the pitchfork. Target is somewhere above 50%-75%. You have at least a 1:1 risk-to-reward ratio. Need to calculate target level by asset based on historic patterns.

Does it work?
Don't know yet. So far I've manually painted a few of those pitchforks in the chart for the past couple of days on FTSE100, NASDAQ, CL and NG and it seems it works more often than it doesn't.
Cases where it clearly doesn't work is when there's a strong move to either direction, aka price breaks-out and moves to a different level than it was the day before. Interestingly when this happens, the strategy wouldn't necessarily always result in a loss, but sometimes the entry conditions would never be triggered in the first place. E.g. if we start the day already in the high region (above 75%) and then never fall below it - no order triggered on that day.
On the negative side, huge breakout opportunities are missed with this strategy, so worth looking into a complementary strategy which works specifically for break-outs.

Next steps
Next, I'm trying to backtest the strategy. Will need to pull a whole lot of data and analyse. Hope to have that done over the weekend. Will update the thread accordingly.
Data I'm trying to get: Win ratio, Where's the optimum take profit level, Time of day where this usually plays out (my idea is to hook this in with the ATR analysis I've done and trade this pattern at times of high ATR, aka FTSE, DAX in the morning, NASDAQ, NG, CL in the afternoon) 

First success
First successful example trade taken this afternoon on CL.
You see nicely how the pitchfork is drawn on the chart and is derived by the high and low of the previous day.
At 14.30 today the price dipped below the 25% level. I set the buy stop order at the 25% level, which got triggered at 14.35. The price afterwards makes a sweep move up to the 50% level, where my limit sell order gets triggered at 15.15. It would've been possible to play it up until the 75% level, but wanted to be safe, without having the data yet.
Could've been luck - who knows.

 

What do you think of this approach?

 

image.thumb.png.3d38406536cc114b0fd420827cce8cd1.png

 

 

 

you seem to set a good set of rules, but I have always found forks a little subjective, even personal. Different people see different ones. Here's mine

Capture fork.PNG

  • Like 1

Share this post


Link to post
Guest Trader Martino

Forget the charts , trade price from a Macro Economic Outlook over a longer period , build a Long Short portfolio less stress more money.....

Share this post


Link to post
17 hours ago, elle said:

you seem to set a good set of rules, but I have always found forks a little subjective, even personal. Different people see different ones. Here's mine

Yeah, the fork is not the main criteria here, it's just a helper to define entry and exit points.

I'm currently backtesting different entry/exit points to see what works best (at least historically).

Share this post


Link to post
4 hours ago, Guest Trader Martino said:

Forget the charts , trade price from a Macro Economic Outlook over a longer period , build a Long Short portfolio less stress more money.....

That's something also professional traders aka Anton Kreil always say.

The question is, how would you approach a strategy which is based purely on macro economics?

I also doubt you make more money with this approach, but yes you have probably less stress.
As markets don't move in a straight line, but go up and down, the one who capitalises on each up and down turn should make more than the one who just holds through.

Share this post


Link to post
13 minutes ago, DSchenk said:

Yeah, the fork is not the main criteria here, it's just a helper to define entry and exit points.

I'm currently backtesting different entry/exit points to see what works best (at least historically).

Very interesting idea. What software are you using to backtest it?

I'm also keen to backtest it, I've built a crude system for backtesting using the IG Index API, I'm tempted to tweak it to test this idea! Will report back here with results if/when I get it up and running.

Share this post


Link to post
2 minutes ago, andysinclair said:

What software are you using to backtest it?

Using ProRealTime at the moment

But also though first using the API. The backtest functionality of PRT is not too bad though, as you can run through variables up until 10,000 combinations.
Currently running through different combinations of TP, SL and entry points

Share this post


Link to post
Guest linus

what are the results of your back testing  ?

 

Share this post


Link to post
19 hours ago, elle said:

Be careful with only looking at fundamentals, is what the video wants to tell, I guess

Someone else once said (can't quite remember who - think it was a quant fund manager): The market can behave longer irrational than you have equity to be in it.

Meaning, all the fundamentals point towards this company is to go bust, you go short, but the share price keeps rising until you receive your margin call and get pulled out of the trade. Afterwards the company goes bust.

Consequently this means, timing is more important than getting the overall direction right. And that in return means, technical analysis is more important than fundamentals.

Share this post


Link to post

Ok, I've got some initial results from backtesting this strategy on FTSE 100.

I was backtesting over 100,000 5min untits, that's the maximum PRT can do. It's a timeframe of approx. 1 year and a quarter.

High Level Results are:

Gain: 130%

Winning trades: 60%

So, promising results at first glance, but obviously way below expectations. In order for this to be a successful strategy, we would need a gain of something more in the area of 1200% over that timeframe.

Not saying this strategy can't achieve this though, if we find a way to tweak it accordingly. Couple of issues to iron out:

1) In the first 3 months it doesn't seem to make any profits at all. Need to find out why this is the case and how the strategy can be tweaked.

2) Then between Nov 18 and Sep 19 the strategy seems to be largely flat as well. Need to investigate this as well

3) Position sizing is currently set as a constant, this needs to be turned into a formula to make the strategy scalable, but couldn't figure out so far how it's best to approach this

4) There are entire months where this strategy produces a loss - need to figure out why and how to avoid

 

Btw, there are two parameters which I did let PRT optimise:

1) Target Profit: Result was that the TP level is optimal if it is set 10 points behind the mid level (50% level). So e.g. when entered long at the 25% level, then the price moves up and crosses the mid level and then makes another 10 points before profits are taken

2) Stop Loss. This is interesting. The optimisation concluded that the TP level is 65 points below the 0% level (or 65 points above the 100% level when shorting). This seems to be a large divergence, which makes me think the strategy itself needs further tweaking. Maybe taking high and low of previous day is not the optimal, but we need to build a range of previous x days and draw the fork over that.

 

Will keep looking at this and update the thread accordingly.

image.thumb.png.3783aafce1e9bae0a860588fe3db2a3f.png

 

image.thumb.png.35b942e0c9f1f8b9c4055b683bf73f20.png

Edited by DSchenk

Share this post


Link to post

Ok, so I took this approach to the next level.

Rather than telling the algorithm enter long at 25% and enter short at 75% levels, I decided to let the algorithm decide itself at what levels its best to enter short or long.

This simplifies the strategy and boosts its gains dramatically.

Top level stats over 100,000 5min candles:

Gain: +1,307%

% of winning trades: 60%

Starting with a £2000 account, after 1 year and 1 quarter that account would have grown to almost £30k (£28k).

The equity curve looks also a lot more stable, too.
I resolved the issue with the lot size, this is now a formula.
Unfortunately we still have 3 negative months, but overall the max runup is a lot higher than the max drawdown.

Overall time in market is only 20%, so there should be the opportunity to run multiple of this strategy on different assets simultaneously to further boost the return. If let's say 3 of these programs could run simultaneously and deliver similar results you could grow £2000 to £100k within about 18 months. Still not as good as the results of the few world-class top traders like Ross Cameron from Warrior Trading, etc but a start nonetheless.

The variables which the program optimised are the following:

  • Take Profit for Long Positions: 84 points
  • Take Profit for Short Positions: 70 Points
  • Entry LvL for Long Positions: 23 Points below the low of previous day
  • Entry LvL for Short Positions: 7 Points below the high of previous day

Interestingly, it turned out the strategy works best without a set stop-loss, but just to close out any open positions at 21.00 o'clock at night, if not already closed by the take profit rule.

I'm gonna simulate this on NASDAQ next. Obviously will need to find out the 4 variables again, as these will be subject to the Index where this is traded.

 

What do you guys think? Worth a shot this strategy?

 

image.thumb.png.74be91645ee513cee6bfc5a8401a5fe8.png

image.thumb.png.b41c0e8f406101efe10577462fdf1f90.png

Share this post


Link to post

Hello,

I am new to pro real time and I am very interested in your strategy, I've tried but so far have failed to implement your strategy on my own pro real time platform. Can you help me with how I could add this and would this trading strategy for all stocks and indices?

Thank you,

E.

Edited by EugeneB

Share this post


Link to post
16 hours ago, elle said:

the link to some original stuff on this topic https://www.andrews-lines.com/

"Eventually, Alan Andrew began selling The Action-Reaction Course, a 60-page course available for $1,500 in the 1960s and 1970s."

Holy sh!t. $1,500 for a trading course in the 1960s. And in 2019 courses are sometimes only $977.
Equivalent of $1,500 in 1960, would be $13k in 2019.

Share this post


Link to post
17 hours ago, EugeneB said:

Hello,

I am new to pro real time and I am very interested in your strategy, I've tried but so far have failed to implement your strategy on my own pro real time platform. Can you help me with how I could add this and would this trading strategy for all stocks and indices?

Thank you,

E.

Hi @EugeneB,

shoot me your questions.

This strategy would only work for indices (I believe at this moment - cause stocks move to irregular) and the 4 parameters (TPL, TPS, Entry L, Entry S) need to be assessed for each index individually.

I'm going to model this for NASDAQ and DAX next and also gonna look at commodities like NG and CL.

Share this post


Link to post

FTSE 100 today. (I didn't trade it btw, cause all my margin was tied up in Prudential)

Black line is the previous high of day (I call that L100, for Lvl 100%).
Red line would be the entry level of L100 - 7 points.

According to the strategy, take profit level would be 70 points below the entry level, which is too far away for my taste. Time in market needs to be reduced as much as possible.

I'm looking to optimise the strategy for a smaller take profit level. Looking at the chart today, something like 40 points would've been ideal for a 20min trade.

image.thumb.png.8e4480f713e82fbb2ae4f9354afbeced.png

Share this post


Link to post

Hello @DSchenk,

Thanks for the reply. I have never coded previously and I cant seem to input your parameters on prorealtime through the easy method. 

Thank you,

E.

Share this post


Link to post

Alright. Got you.
Code is below.

Variables need to be set for FTSE to

  • X = -23
  • y = 7
  • TPL = 84
  • TPS = 70
Quote

// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
DEFPARAM FLATAFTER = 210000

// Prevents the system from creating new orders to enter the market or increase position size before the specified time
noEntryBeforeTime = 080000
timeEnterBefore = time >= noEntryBeforeTime

// Prevents the system from placing new orders to enter the market or increase position size after the specified time
noEntryAfterTime = 160000
timeEnterAfter = time < noEntryAfterTime

// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0

size = (2000/400) + ROUND(STRATEGYPROFIT / 800)

// Levels 0% and 100%
if OpendayofWeek <> 1 then
L0 = DLow(1)
L100 = DHigh(1)
elsif OpendayofWeek = 1 then
L0 = DLow(2)
L100 = DHigh(2)
Endif
GRAPHONPRICE L0
GRAPHONPRICE L0 + x COLOURED (200,0,0)
GRAPHONPRICE L100
GRAPHONPRICE L100 - y COLOURED (200,0,0)

// Conditions to enter long positions
c1 = high crosses over L0 + x
//c12 = close > L25-5

IF c1 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
BUY size PERPOINT AT MARKET
SET TARGET PPROFIT TPL
//SET STOP PLOSS SL
ENDIF

// Conditions to enter shortpositions
c3 = low crosses under L100 - y
//c32 = close < L75+5

IF c3 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
SELLSHORT size PERPOINT AT MARKET
SET TARGET PPROFIT TPS
//SET STOP PLOSS SL
ENDIF

 

Share this post


Link to post

Thank you @DSchenk!

I've entered the code on to the platform and seems to work, however on the ftse100 it seems to only work on the 5minute intervals and only 1 trade occured. Have I somehow messed up the code? if so could you please assist me. Thank you so much for sharing great information by the way, it means a lot!

E.

Share this post


Link to post

Yeah, only tested on a 5min chart so far.

It does about 177 trades in 1 year and a quarter, so less than 1 trade per day on average

Share this post


Link to post

// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
DEFPARAM FLATAFTER = 210000

// Prevents the system from creating new orders to enter the market or increase position size before the specified time
noEntryBeforeTime = 080000
timeEnterBefore = time >= noEntryBeforeTime

// Prevents the system from placing new orders to enter the market or increase position size after the specified time
noEntryAfterTime = 160000
timeEnterAfter = time < noEntryAfterTime

// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0

size = (2000/400) + ROUND(STRATEGYPROFIT / 800)

// Levels 0% and 100%
if OpendayofWeek <> 1 then
L0 = DLow(1)
L100 = DHigh(1)
elsif OpendayofWeek = 1 then
L0 = DLow(2)
L100 = DHigh(2)
Endif
GRAPHONPRICE L0
GRAPHONPRICE L0 + -23 COLOURED (200,0,0)
GRAPHONPRICE L100
GRAPHONPRICE L100 - 7 COLOURED (200,0,0)

// Conditions to enter long positions
c1 = high crosses over L0 + -23
//c12 = close > L25-5

IF c1 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
BUY size PERPOINT AT MARKET
SET TARGET PPROFIT 84
//SET STOP PLOSS SL
ENDIF

// Conditions to enter shortpositions
c3 = low crosses under L100 - 7
//c32 = close < L75+5

IF c3 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
SELLSHORT size PERPOINT AT MARKET
SET TARGET PPROFIT 70
//SET STOP PLOSS SL
ENDIF
 

Share this post


Link to post

Eventhough I've set the backtest time frame for a year, only one trade occurs on the 17th of Oct 2019

Screen Shot 2019-10-21 at 12.32.38 PM.png

Share this post


Link to post

you probably need to set your chart to display 100,000 units as well

image.png.a8051650a1ea05c1f178bcd7f95d97a3.png

Also the code uses initial capital of 2000, not 10,000

you can change it in this line though

Quote

size = (2000/400) + ROUND(STRATEGYPROFIT / 800)

 

 

Share this post


Link to post

When I, updated the units (x)units it automatically set the units to 15000 and the results are amazing, however when I put 100,000 it's showing me terrible results. I find this crazy fascinating. 

Screen Shot 2019-10-21 at 12.43.33 PM.png

Share this post


Link to post

Can someone help me understand why just changing the units makes a huge difference? Thank you

Share this post


Link to post

looks like your position sizing is way off

in the first example you make way too much profit and in the second example your account blows up with the first trade

Share this post


Link to post

Was able to optimise the strategy a little more for FTSE 100.

Managed to work with smaller TP levels, which led to a reduction of time in market. Also % of winning trades went up.

Optimised the entry condition a bit more as well, now working with stop orders not market orders.

New stats:

Gain: 1380% (+73% vs previous run)

% of winning trades: 64% (+4% vs previous run)

Time in market: 18% (-2% vs previous run)

image.thumb.png.fdd3e1870e7499feb720428f8cdef622.png

 

Would've turned out marvellously for today btw. Hit perfectly the high and low candle of this move.

image.png.c0ba53d94b87cb4416178507e44fb051.png

Share this post


Link to post

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Member Statistics

    • Total Topics
      7,766
    • Total Posts
      40,441
    • Total Members
      50,823
    Newest Member
    MrMack
    Joined 18/11/19 12:34
  • Posts

    • Some excuse is needed for a pullback ...
    • The spike down in indices in the last hour was the same ol' trade war news, China stating they are less optimistic than the US and feel they have been mislead by recent talks where they felt they had agreement over a rollback of tariffs that the US now say is not the case. After 18 months of this you should be use to it by now. 
    • Dax, Nikkei and FTSE100 remain below recent (past 2 weeks) turning points and we have seen an interesting recent bearish candle in play on US large caps, a potential spike and retrace back down, which could signal rally exhaustion.  In the case of the Dow and Nasdaq this occurred with an overshoot of the 4H chart rally channel and in the case of the Nasdaq also the Daily and Monthly long term resistance trend lines (overshoot and quick retrace being a particular signal of an exhaustion phase).  In the case of the SP500 this has occurred with a hit right on the Daily resistance trend line and rejection, so far at least.  As I have mentioned before: with volume relatively weak and seemingly in a down trend; and with COT net long positions weak and weakening (not what one would expect of a breakout rally); and with Gold/Silver rallying; and with NMD at the turn points on all markets and as USDJPY has also taken a similar bearish hit; the odds of a bearish phase are good and the risk reward is decent. I am already Short Dax and FTSE100 off the previous turns but money where my mouth is this time on SP500, as the exposure is tiny, I am Short off the hit and turn on the daily trend line with tight stops just above.  
×
×