Strategy Logic As discussed in the previous chapter Input
Comparison Difference in prices >= parameter
Signal buy
sell
parameter Difference in prices < parameter
No change
New Strategy Logic (create an indicator) Input
Parameters:
box size reversal size
Create an Indicator (call it benchmark)
Using box size update benchmark
Comparison
Signal
Diff in Price & benchmark meets reversal size criterion
Buy
Not met reversal size criterion
sell
No change
Why: The trading idea* *Based on Point & Figure charts • Trend following strategy: It tries to predict when prices will begin to rise or fall. • If prices are going up consistently, update the benchmark. Don’t sell. Wait for a movement in downward direction. If the movement is significant (>= reversal size), SELL. Else hold on to your position, the prices are simply re-adjusting.
• Same logic in other direction
Trending data We make money when we can buy/sell at the bottom/top of an upward/downward movement
Trending data Track when price movement has crossed a minimum pre-defined amount called ‘reversal size’ to generate buy/sell orders Use an indicator called ‘benchmark’ which gets updated as per the ‘box size’
Indicator: benchmark Logic for creating/updating benchmark Greater than or equal to box size
Change
Less than box size
No change
Greater than or equal to reversal size
Change
Less than reversal size
No change
Movement in same direction
Start with a benchmark value Movement in opposite direction
Input parameters • Using which an indicator is created • On which trading signals & strategy output depends • Based on which a strategy can be optimized Movement in same direction Start with a benchmark value Movement in opposite direction
Greater than or equal to box size
Change
Less than box size
No change
Greater than or equal to reversal size
Change
Less than reversal size
No change
BOX SIZE
REVERSAL SIZE
Initialize input parameters in R • Tick size is the minimum amount of movement in prices reported by the exchange. It is usually fixed at 0.05. • Box size in prices is a multiple of tick size • Reversal size in prices is a multiple of box size #initialize ticksize ticksize = 0.05 #initialize box size in terms of number of boxes INPUT PARAMETERS bsiz_box = 4 #number of boxes for reversal brev_box = 12 # Find box size in terms of prices. This number would be used in price comparisons: bsiz = bsiz_box*ticksize # Find reversal size in terms of prices. This number would be used in price comparisons: brev = brev_box*bsiz
Example with sample data We will work with the sample data of simple numbers to understand the logic. ticksize = 1, bsiz_box = 4, brev_box = 2 bsiz = 4 & brev = 8 (in prices)
Signal ---buy no change sell no change no change no change no change no change buy
Box size= 4 Reversal size = 8 120 116 112 108
104 100 96 92 88 84
80 76
Benchmark Closing Price
Running the strategy bsiz = 4 & brev = 8 (in prices) S. No.
Closing Price
Benchmark
1
100
----
Signal
Explanation for signal
initialize value to closing price in first row 109 - 100 > 8, first signal
2
109
100
3
117
108
4
105
116
5
90
108
2-box increase from 108 to 116 2-box decrease to from 116 to no change 108
6
81
92
no change 4-box decrease from 108 to 92
7
85
84
8
84
84
9
90
84
10
100
84 100
buy
Explanation for benchmark
no change 2-box increase from 100 to 108 sell
same direction 116 - 105 > 8, opposite signal same direction
same direction reversal size criteria not no change 2-box decrease to from 92 to 84 met (84, 85) reversal size not met (85, 84), no change no change No change in price reversal size criteria not no change No change in price met (84, 90) reversal size not met (84, 90), 100 - 84 >8, opposite buy no change signal 4-box increase from 84 to 100
120 116 112 108
104 100 96 92 88 84
80 76
Benchmark changes with large price movements Benchmark
Prices move in large amounts or in same direction so benchmark changes
Closing Price
120 116 112
Benchmark static due to small price movements Benchmark Closing Price
108
104 100 96 92 88 84
80 76
Prices move in small amounts so benchmark remains the same