SAT2021-07 Fractals 1

This week’s idea is based on the concept of Fractals, popularized by Bill Williams in his books Trading Chaos and New Trading Dimensions.  A fractal high occurs when the highest high of five bars is on the third, or middle, bar.  A fractal low occurs when the lowest low of five bars is on the third bar.

A high fractal looks like this:

  • First bar High < Third bar High
  • Second bar High < Third bar High
  • Fourth bar High < Third bar High
  • Fifth bar High < Third bar High

This is a high fractal:

A fractal low would be the opposite:

  • First bar Low > Third bar Low
  • Second bar Low > Third bar Low
  • Fourth bar Low > Third bar Low
  • Fifth bar Low > Third bar Low

Fractals can be very confusing and deceiving.  If you use them on a chart, do not fall for the illusion that they can predict the future.  The fractal will appear only after that fifth bar has closed and the conditions for the fractal have been met. 

Fractal trading signals can be used several ways.  This idea uses the fractal high as a resistance level and fractal low as a support level.  When we break through resistance or support, we go long or short, respectively.  Below is an example of how this is used for support and resistance (Chart: daily Euro FX futures):

For my exits, I will be testing trailing stop and profit target.  The profit target is based on ATR (Average True Range).  I am not a huge fan of using profit targets, but I want to try this to see if it provides a good exit.

Thanks to Sintia for this idea!

Phase 1: Plan & Design

1. Trading Idea

The idea is simple:

  • Buy at market when if the Close is greater than the latest Fractal High
  • Sell short at market if the Close is less than the latest Fractal Low
  • Reverse our position if we receive a buy or sell short signal
  • Profit Target and Stops:
    • Long position:
      • Set Profit Target to a multiple of ATR’s from the entry price for the first N bars (where N = number of bars since entry)
      • After N bars, then set trailing stop to Low of the last closed bar
    • Short position:
      • Set Profit Target to a multiple of ATR’s from the entry price for the first N bars (where N = number of bars since entry)
      • After N bars, then set trailing stop to High of the last closed bar

The profit target is meant to be in place for certain number of bars, but if too much time has passed, I will switch to a trailing stop at the low (for long positions) or high (for short positions).

2. System Definition

Position Sizing:

  • Futures:  1 contract
  • Forex: 100,000 lot size

Input Parameters:

I will use the following input parameters:

Input(Default)Data TypeOptimizable?Comments
FractalStrength(2)integerYesThis is the number of bars before and after the fractal to evaluate; 2 = a 5 bar fractal (2 bars before, 2 bars after), 1 = 3-bar fractal, etc.
ATRLength(5)integerYesThe number of bars used for ATR calculation
ATRMultiple(2)doubleYesThe number used to multiply by the ATR to determine the target price
NumBars(5)integerYesThe number of bars to use the target price, before switching to a trailing stop

Variables:

VariableData TypeDefaultCalculation
FractalHighDouble0The calculation will vary depending on FractalStrength;  

Example (FractalStrength = 2):
if High[2 bars ago] > High and   
High[2 bars ago] > High[1 bar ago] and   
High[2 bars ago] > High[3 bars ago] and   
High[2 bars ago] > High[4 bars ago]
then   
FractalHigh = High[2 bars ago]  
FractalLowDouble0The calculation will vary depending on FractalStrength;

Example (FractalStrength = 2):
if Low[2 bars ago] < Low and   
Low[2 bars ago] < Low[1 bar ago] and   
Low[2 bars ago] < Low[3 bars ago] and   
Low[2 bars ago] < Low[4 bars ago]
then
FractalLow = Low[2 bars ago]  
ATRDouble0ATR = Average True Range over ATRLength bars
TargetPriceDouble0If long:
TargetPrice = EntryPrice + ( ATR x ATRMultiple )  

If short:
TargetPrice = EntryPrice – ( ATR x ATRMultiple )  
EntryPriceThe entry price for the current position
BarsSinceEntryThe number of bars since entry

Entry:

  • Long:
    • If Close > FractalHigh, then buy next bar at market
  • Short:
    • If Close < FractalLow, then sell short next bar at market

Exits:

  • Long:
    • If BarsSinceEntry < NumBars
      • TargetPrice = EntryPrice + ( ATR x ATRMultiple )
      • Sell next bar at TargetPrice Limit
  • Short:
    • If BarsSinceEntry < NumBars
      • TargetPrice = EntryPrice – ( ATR x ATRMultiple )
      • Buy to cover next bar at TargetPrice Limit

Challenges:

  • None

3. Performance Objectives

The system will meet the following objectives:

ObjectiveGoal
Strategy Type (trend, mean-reversion,
day, swing, etc.)
Swing
Risk of ruin0%
Profit Factor>= 1.3
Win Percent>= 30%
Max Drawdown %< 35%
Profit/Drawdown Ratio>= 2.0
Ready Date2021/03/19

This idea is S.M.A.R.T.: Specific, Measurable, Achievable, Realistic, Time-bound

4. Market Selection

Markets:

EnergiesCurrenciesFixed IncomeAgricultureMetalsSoftsIndexesEquities
XXX

Instruments:

Market GroupInstrumentSymbolComments
EnergiesGasoline, Crude Light, Natural Gas, Heating OilRB, CL, NG, HO 
AgricultureSoft Red Wheat, Oats, Lean HogsW, O, LH 
MetalsSilver, Gold, CopperSI, GC, HG 

Chart Type, Timeframe, Session, Time Zone:

AttributeValueComments
Chart TypeRegular CandlestickCharting is only useful for validating entry and exit signals
Timeframe / Interval(s)Daily, 1440 minutes, 360 minutes I like to test on 1440 minutes, which is equivalent to the Daily
timeframe, but which may have a different closing price.
SessionRegular 
Time ZoneExchange 

Phase 2: Build

5. Manual Test

I manually tested on Crude Light and it works.

6. Build

Process Diagram

Comments:

This is a new style of exits than I have demonstrated up to this point, where we will switch from a profit target to a trailing stop after being in the market for a specified number of bars.

7. Unit Test

Complete?

Note: Unit Test verifies that the system is executing the trading rules correctly.  It is, essentially, quality control.

Phase 3: Test

8. Optimization

I optimized these parameters:

  • FractalStrength: Range 1 – 2, step 1
  • ATRLength: Range 5 – 15, step 5
  • ATRMultiple: Range 1.5 – 4.0, step 0.5
  • NumBars: Range 3 – 9, step 1

9. Walk-Forward Analysis

This idea was built with energies in mind, so it is no surprise that I had at least one instrument work: Heating Oil (HO).  There were several walk-forward tests that may work, so I picked what I believe to be the strongest candidate:

In PeriodOut Period Net Profit Max DD Avg DD Return / Max DD Return / Avg DD Annualized Net ProfitAnnualized Return / Avg DDWF Efficiency
378252156,761(21,431)(4,169.99)7.3137.5918,698.594.4866%


All other instruments failed. 

10. Monte Carlo Simulation

Result: Pass

For this system, I would need to have an account with $52,500 to have a zero risk of ruin.  That is a huge amount of money to allocate, as a smaller trader, but the annual median return is huge by just about any measure.

11. Incubation

Result: Pass

This was an easy one, considering Heating Oil has been on an absolute tear since at least November.  Net profit for 6+ month incubation, (September 1, 2020 to March 12, 2021): $12,505.  Scorching.    

Here is the total equity curve for this system:

Phase 4: Deploy

This one is going into the SAT Portfolio, with a start date of March 14, 2021.  This was the easiest decision I made all week.

Notes and Commentary

Well, happy day!  I do not have much to say.  Everything went well, testing was easy, and I like that we got at least one instrument working with this strategy.  I thought Crude Light or RBOB Gasoline would have worked, but it was Heating Oil that won in the end. 

I would like to give a special thanks to Sintia Stabel for providing this idea and the base entry code.  She and I have collaborated a lot with Bill Williams’ Fractals, so it was nice to see it produce a working trading system.

There are two ideas I would like to explore, expanding on fractals even further:

  • Use only an ATR based trailing stop
  • Use limit orders for entry, rather than market

Look for this to show up in a future system idea. If you want to watch Bill Williams, who passed away in 2019, teaching fractals, check out the YouTube video in the Sources/References section.  The guy was a hoot.

Trading System Result: SUCCESS

Sources/References

Did you like what you read? Do you want to see more?  Subscribe now and receive our weekly email, with the Trading System Idea of the Week and other fun stuff.

Don’t worry, we will never, ever, ever sell, overuse, or donate your email address. Promise.

Did you like what you read? Do you want to see more?  Subscribe now and receive our weekly email, with the Trading System Idea of the Week and other fun stuff.

Don’t worry, we will never, ever, ever sell, overuse, or donate your email address. Promise.

2 thoughts on “SAT2021-07 Fractals 1

Leave a Reply

Your email address will not be published. Required fields are marked *