Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

7/31/23, 2:07 AM Combo Strategy 123 Reversal and ADXR — Indicator by HPotter — TradingView India

Get started

Combo Strategy 123 Reversal and ADXR


HPotter WIZARD Apr 26, 2019

S&P 500 E-mini Futures · 1h · CME O2924.50 H2925.50 L2922.50 C2924.00 −0.50 (−0.02%)
Combo 14 1 3 50 14 14 13 45

Oscillators strategies reversal Average Directional Movement Index Rating (ADXR) ADX 0 65
movement

This is combo strategies for get


a cumulative signal. Result signal will return 1 if two strategies
is long, -1 if all strategies is short and 0 if signals of strategies is not equal.

First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.

Secon strategy
The Average Directional Movement Index Rating (ADXR) measures the strength
of the Average Directional Movement Index (ADX). It's calculated by taking
the average of the current ADX and the ADX from one time period before
(time periods can vary, but the most typical period used is 14 days).
Like the ADX, the ADXR ranges from values of 0 to 100 and reflects strengthening
and weakening trends. However, because it represents an average of ADX, values
don't fluctuate as dramatically and some analysts believe the indicator helps
better display trends in volatile markets.

WARNING:
- For purpose educate only
- This script to change bars colors.

https://in.tradingview.com/script/S14B1AmX-Combo-Strategy-123-Reversal-and-ADXR/ 1/5
7/31/23, 2:07 AM Combo Strategy 123 Reversal and ADXR — Indicator by HPotter — TradingView India

Open-source script
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it
for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations
supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?

Add to favorite indicators

Combo Strategy 123 Reversal and ADXR Copy code

1 //@version=3
2 ////////////////////////////////////////////////////////////
3 //  Copyright by HPotter v1.0 26/04/2019
4 // This is combo strategies for get 
5 // a cumulative signal. Result signal will return 1 if two strategies 
6 // is long, -1 if all strategies is short and 0 if signals of strategies is not equal.
7 //
8 // First strategy
9 // This System was created from the Book "How I Tripled My Money In The 
10 // Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
11 // The strategy buys at market, if close price is higher than the previous close 
12 // during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
13 // The strategy sells at market, if close price is lower than the previous close price 
14 // during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
15 //
16 // Secon strategy
17 // The Average Directional Movement Index Rating (ADXR) measures the strength 
18 // of the Average Directional Movement Index (ADX). It's calculated by taking 
19 // the average of the current ADX and the ADX from one time period before 
20 // (time periods can vary, but the most typical period used is 14 days).
21 // Like the ADX, the ADXR ranges from values of 0 to 100 and reflects strengthening 
22 // and weakening trends. However, because it represents an average of ADX, values 
23 // don't fluctuate as dramatically and some analysts believe the indicator helps 
24 // better display trends in volatile markets.
25 //
26 // WARNING:
27 // - For purpose educate only
28 // - This script to change bars colors.
29 ////////////////////////////////////////////////////////////
30 Reversal123(Length, KSmoothing, DLength, Level) =>
31     vFast = sma(stoch(close, high, low, Length), KSmoothing) 
32     vSlow = sma(vFast, DLength)
33     pos = 0.0
34     pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
35              iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0))) 
36     pos
37
38 fADX(Len) =>
39     up = change(high)
40     down = -change(low)
41     trur = rma(tr, Len)
42     plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, Len) / trur)
43     minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, Len) / trur)
44     sum = plus + minus 
45     100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), Len)
46
47 ADXR(LengthADX, LengthADXR, Signal1, Signal2) =>
48     xADX = fADX(LengthADX)
49     xADXR = (xADX + xADX[LengthADXR]) / 2
50     pos = 0.0
51     pos := iff(xADXR < Signal1, 1,
52            iff(xADXR > Signal2, -1, nz(pos[1], 0))) 
53     pos
54
55 study(title="Combo Backtest 123 Reversal and Average Directional Movement Index Rating", shorttitle="Combo", overlay = true)
56 Length = input(14, minval=1)
57 KSmoothing = input(1, minval=1)
58 DLength = input(3, minval=1)
59 Level = input(50, minval=1)
60 LengthADX = input(title="Length ADX", defval=14)
61 LengthADXR = input(title="Length ADXR", defval=14)
62 Signal1 = input(13, step=0 01)
https://in.tradingview.com/script/S14B1AmX-Combo-Strategy-123-Reversal-and-ADXR/ 2/5

You might also like