Un po' di Storico....
http://www.finanzaonline.com/forum/futures-cfd-leverage-certificate-cw-e-commodities/1845662-ftsemib-e-altri-indici-materie-prime-133-a.html
132 -
131 -
130
129 -
128 -
127 -
126 -
125 -
124 -
123 -
122 -
121 -
120
119 -
118 -
117 -
116 -
115 -
114 -
113 -
112 -
111 -
110
109 -
108 -
107 -
106 -
105 -
104 -
103 -
102 -
101 -
100
99 -
98 -
97 -
96 -
95 -
93 -
92 -
91 -
90
89 -
88 -
87 -
86 -
85 -
84 -
83 -
82 -
81 -
80
79 -
78 -
77 -
76 -
75 -
74 -
73 -
72 -
71 -
70
69 -
68 -
67 -
66 -
65 -
64 -
63 -
62 -
61 -
60
59 -
58 -
57 -
56 -
55 -
54 -
53 -
52 -
51 -
50
49 -
48 -
47 -
46 -
45 -
44 -
43 -
42 -
41 -
40
39 -
38 -
37 -
36 -
35 -
34 -
33 -
32 -
31 -
30
29 -
28 -
27 -
26 -
25 -
24 -
23 -
22 -
21 -
20
19 -
18 -
17 -
16 -
15 -
14 -
13 -
12 -
11 -
10
9 -
8 -
7 -
6 -
5 -
4 -
3 -
2 -
1
Il TS ADX/ADM
L’ADX o
Average Directional Index
è un ottimo indicatore di medio periodo però
indica solo la forza del trend e non la sua direzione.
Il valore dell’ADX può essere compreso tra 0 e 100. Tipicamente un trend caratterizzato da un ADX al di sotto del 20 è considerato debole, mentre sopra 25 è da considerarsi forte.
Molto più utili gli indicatori +DI (Positive Directional Indicator) ed il -DI (Negative Directional Indicator), considerando la loro media a 14 giorni: +DI14 in verde e -DI14 in rosso.
I loro incroci deteminano la la direzione del trend.
+DI14 > -DI14+FlatZone = LONG
+DI14 < -DI14-Flatzone = SHORT
FLAT nella fascia -Flatzone+Flatzone dell'incrocio
la Flatzone era -10% +10% nelle vecchie versioni , ora è calcolata anche essa in base a dei backtest periodici
L'ADM o Average Daily Movement è un indicatore Intraday basato sulla volatilità
vengono dati ogni giorno 2 entry (Long o Short) e 3 Take Profit (Long e Short)
Operativamente:
si entra long/short se alla chiusura oraria (alle 10, alle 11, ecc) il valore dell’indice è superiore/inferiore all’entry long/short giornaliero
poi
se non arriva il TP xx entro chiusura
se siamo in trend (vedi ADX) si va in over e il giorno dopo si chiude se entra il segnale di reverse
se siamo controtrend (ADX contrario) si chiude in chiusura mercato
per esempio…
al segnale io entro long con 3 posizioni (3 contratti, ecc…)
la 1° pos va in take profit sul TP1 (alla battuta)
la 2° sul TP2 (alla battuta) una volta fatto il TP1 (candela oraria) si alza lo stop loss sull’entry
la 3° sul TP3 (alla battuta) una volta fatto il TP2 (candela oraria) si alza lo stop loss sul TP1
- se ADX è FLAT o LONG, se non ha raggiunto uno dei target si porta la posizione in over…..
il giorno dopo al raggiungimento del TP1 si vendono tutte le posizioni e si aspettano i segnali nuovi, se invece non arriva l’ex-tp1 ma entra l’entry contraria si chiude tutto e si reversa.
- se ADX è SHORT meglio chiuderla in giornata
Varianti intraday
i livelli sono da considerare come resistenze/supporti
una volta superata una resistenza diventa supporto, e viceversa….
per esempio il 21/04/2015
ha fatto
1 – entry long
2 – entry short (stop loss & reverse)
3 – tp1 short
4 – ex-entry short (nuovo entry long)
5 – ex-entry long (nuovo tp1 long)
Calcolo dei livelli intraday
ADM è la media su N-giorni della volatilità giornaliera (Max-Min) , la media a N giorni…
io ora lo calcolo periodicamente in base a dei backtest e lo trovate in alto a sinistra nel grafico , nelle prime versioni del TS usavo il valore di 30 giorni, che è abbastanza valido
,altri usano altri valori..
i livelli di entrata vengono calcolati in questo modo
i livelli di entrata vengono calcolati in questo modo:
la teoria standard dice di usare un break-out level = 0.382 (Price Break) , io ultimamente lo sto calcolando ogni giorno in base alla volatilità
(chiusura giorno precedente + Price Break*ADM Ndays) ci dà l’Entry Long
(chiusura giorno precedente – Price Break*ADM Ndays) ci dà l’Entry Short
DayC = chiusura giorno precedente
C = prezzo corrente
Entry Long = C>((DayC)+((Price Break)*(ADM Ndays)));
Entry Short = C<((DayC)-((Price Break*(ADM Ndays)));
ho notato che però quando aumenta la volatilità il price break posto a 0,382 genera diversi falsi segnali
pertanto dalla versione 3.0 sto sperimentando questa formula…
Price Break=(0,382+0,382*((ADM 10 days-ADM Ndays)/ADM Ndays))
I target invece vengono così calcolati….
Target 1 Long = (0.45*ADM)+Entry Long;
Target 2 Long = (0.95*ADM)+Entry Long;
Target 3 Long = (1.95*ADM)+Entry Long;
Target 1 Short = Entry Short-(0.45*ADM);
Target 2 Short = Entry Short-(0.95*ADM);
Target 3 Short = Entry Short-(1.95*ADM);
-----------------------------------------------------------------------------------
Probabilità dei vari TP
-----------------------------------------------------------------------------------
Implementazioni su piattaforme Standard:
ADM v. 2. 0 per Amibroker by Murali krishna
http://www.wisestocktrader.com/indicators/4059-ultimate-volatility-trading-system-v-2.txt
ADM per VisualTrader by Strong
Codice:
{******************************************************************************
* ADM by Strong.
*
* Versione 1 fix 1 del 18/04/2014
*
* Filtro ingressi ATTIVO
*
******************************************************************************}
Var:
newDay(false), // CAMBIO GIORNO
numDay(0), // STORICO GIORNI PER CALCOLO ADM
lastRange,lastClose,HistoryRange,HistoryClose, // VALORI END OF DAY
num(0),den(0),adm(0),STORICO_ADM(30), // ADM
targetLong(0),targetShort(0), // TARGET X USCITA
stopLossLong(0),stopLossShort(0), // STOPLOSS
flagLong(false),flagShort(false), // SINGOLA OPERAZIONE GIORNALIERA
buf, // TEMPORANEA
zonaPlotting;
//
// ************************ CALCOLO INDICATORE ADM *****************************
//
newDay=GetValues (days, 1, buf,buf,buf,buf);
if newDay then
// FLAG PER GESTIRE UNA OPERAZIONE LONG E SHORT AL GIORNO
flagLong=true;
flagShort=true;
lastRange=EOD.R[1];
lastClose=EOD.C[1];
num = num + lastRange*lastClose;
den = den + lastClose;
// GESTIONE DEL NUMERO DI GIORNI PER IL CALCOLO DELL'INDICATORE
if numDay >= STORICO_ADM then
historyRange=EOD.R[STORICO_ADM];
historyClose=EOD.C[STORICO_ADM];
num = num - historyRange*historyClose;
den = den - historyClose;
endif;
// CALCOLO ADM
adm = num/den;
inc(numDay);
endif;
//
// ************************ LONG ***********************************************
//
if LastBar = false and adm > 0 and flagLong and positionlong = false then
// FILTRO SUGLI INGRESSI
// if (C>H[1] or B[1]) and W and C > lastclose+ (0.382*adm) then
if (C > lastclose + (0.5*adm)) then
// if C > C[1]+ (0.382*adm) then
colorbar(green);
// CancelExitLong("target 0.5");
enterlong(nextBar,atopen);
stopLossLong = 0.5 * adm;
targetLong = adm * 0.5;
flagLong = false;
endif;
endif;
SECTION_EXITLONG:
// STOPLOSS DINAMICO
//exitlong(NextBar,positionvaluethisbar + targetLong , limit, 3 , "Target 0.5");
// STOPLOSS STATICO
// if C < positionvaluethisbar - stopLossLong then
//exitlong(nextbar,atopen);
//endif;
// USCITA A FINE GIORNATA
//if t = 1700 then
// exitlong(bar,atclose);
//endif;
END_SECTION
//
// ************************ SHORT **********************************************
//
if LastBar = false and adm > 0 and flagShort < 1 and positionshort = false then
// FILTRO SUGLI INGRESSI
// if (C < L[1] or W[1]) and B and C < lastclose - (0.382*adm) then
if (C < lastclose - (0.5*adm)) then
//if C < C[1] - (0.382*adm) then
colorbar(red);
//CancelExitshort("Target 0.5");
entershort(nextBar,atopen);
stopLossShort = 0.5 * adm;
targetShort = adm * 0.5;
flagSHort=false;
endif;
endif;
SECTION_EXITSHORT:
//STOPLOSS DINAMICO
// exitshort(NextBar, positionvaluethisbar - targetShort, limit, 3, "Target 0.5");
//STOPLOSS STATICO
//if C > positionvaluethisbar + stopLossShort then
//exitshort(nextbar,atopen);
//endif;
// USCITA A FINE GIORNATA
//if t = 1700 then
// exitshort(bar,atclose);
//endif;
END_SECTION
//
// ************************ PLOTTING *******************************************
//
// DISEGNA I VALORI DI INGRESSO SUL GRAFICO PRINCIPALE
PlotChart(lastclose + adm*0.5 , 0, lime, solid, 1);
PlotChart(lastclose - adm*0.5 , 0, red, solid, 1);
PlotChart(lastclose + adm*0.5 + adm*0.45 , 0, green, Dot, 1);
PlotChart(lastclose - adm*0.5 - adm*0.45 , 0, fuchsia, Dot, 1);
PlotChart(lastclose + adm*0.5 + adm*0.95 , 0, green, Dot, 1);
PlotChart(lastclose - adm*0.5 - adm*0.95 , 0, fuchsia, Dot, 1);
PlotChart(lastclose + adm*0.5 + adm*1.95 , 0, green, Dot, 1);
PlotChart(lastclose - adm*0.5 - adm*0.95 , 0, fuchsia, Dot, 1);
// CREA AREA DI PLOTTING
//zonaPlotting = CreateViewport(200, true, true);
// DISEGNA I VALORI DI CALCOLO SULLA AREA DI PLOTTING (FACOLTATIVO)
//PlotChart(historyRange, zonaPlotting, blue, solid, 1);
//PlotChart(lastRange, zonaPlotting, red, solid, 1);