Ciao a tutti vorrei sapere se c’è qualcuno che può spiegarmi come creare un indicatore con le funzionalità del CCI(commodity channel index) con dentro il williams percent range grazie.
La prego di mostrarci un esempio di ciò che si vuole essere disegnato su un grafico? Grazie.
non posso spiegarlo su un grafico perchè la prorealtime non mi fa inserire l’indicatore williams percent range dentro il commodity channel index,se lo faceva non chiedevo aiuto . comunque si tratta si fare in modo che l’indicatore williams%R lavori e si incroci dentro l’indicatore commodity channel index.
Questo può essere quello che cercavi?
E’ un CCI su cui è stato calcolato Williams’R%
// CCI Calculation
//
// The example below is based on a 20-period Commodity Channel Index (CCI) calculation. The number of CCI periods is
// also used for the calculations of the simple moving average and Mean Deviation.
//
//CCI = (Typical Price - 20-period SMA of TP) / (.015 x Mean Deviation)
//Typical Price (TP) = (High + Low + Close)/3
//Constant = .015
//
// There are four steps to calculating the Mean Deviation:
// 1 - subtract the most recent 20-period average of the typical price from each period's typical price.
// 2 - take the absolute values of these numbers.
// 3 - sum the absolute values.
// 4 - divide by the total number of periods (20).
//
Period = max(2,min(999,Period)) //2-999
M = typicalprice
MM = average[Period](M)
Sum = 0
FOR i = 0 to Period - 1
sum = sum + ABS(mm[0]-M[i])
NEXT
D = Sum/Period
MyCCI = (M - MM) / (0.015 * D)
//return MyCCI
////////////////////////////////////////////////////
//PRC_WilliamsRpercent - 01.09.2016 - Nicolas @ www.prorealcode.com
//
hh = highest[period](MyCCI)
ll = lowest[period](MyCCI)
Wp = ((hh-close)/(hh-ll))*-100
return Wp as "Williams R%"//, -20 as "-20 level", -80 as "-80 level"