Thursday, October 14, 2010

Using noise for enter/exit market - noise bars - pro real time formula (adaptive)

 La formula per un indicatore corretto ma adattato è 
//formula adattata a seguito di mail ed articolo S&C, October 2010 by Ron Black
// continuità degli incrementi dei minimi per individuare uptrend - c'è approssimazione: si confrontano solo gli highest low e i lowest high (come da mail) non tutte le candele all'interno
//trasformazione di indicatore che permetta solo di valutare i segnali ed i trend...il resto è noise


if low > highest[n](low) then
    bar = (low- highest[n](low))/WeightedClose*100
    // così abbiamo un'idea della distanza in punti (su totalprice è in percentuale!!)
endif
if high < highest[n](low) then
    bar= (high-highest[n](low))/WeightedClose*100
    //segno meno indica verso downtrend
   
endif
if high < lowest[n](high) then
    bar = (high-lowest[n](high))/WeightedClose*100
endif


if low > lowest[n](high) then
    bar = (low-lowest[n](high))/WeightedClose*100
   
endif

return bar




 point of attention:
a. it's crucial deciding time (bes for n = 5)
b. results are similar to other indicator, however it tends to anticipate a new trend.

==> a Fisher Transform should be used for trying a normalization of gains (in order to decide better stop loss and profits)




// continuità degli incrementi dei minimi per individuare uptrend - c'è approssimazione: si confrontano solo gli highest low e i lowest high (come da mail) non tutte le candele all'interno
myclearbar = CALL "clear bar"[13]
if myclearbar > 0 and low > highest[n](low) then
    bar = low
   
elsif myclearbar > 0 and low < highest[n](low) then
    bar = 0
   
elsif myclearbar > 0 and high < highest[n](low) then
    bar = -2*high

   
elsif myclearbar <= 0 and high < lowest[n](high) then
    bar = -high
   
elsif myclearbar <= 0 and high > lowest[n](high) then
    bar = 0
   
elsif myclearbar <= 0 and low > lowest[n](high) then
    bar = 2*low
   
endif
return bar



OPPURE (altro codice)



// continuità degli incrementi dei minimi per individuare uptrend - c'è approssimazione: si confrontano solo gli highest low e i lowest high (come da mail) non tutte le candele all'interno
myclearbar = CALL "clear bar"[13]
while myclearbar >= 0
    if low > highest[n](low) then
        bar = low
       
    elsif myclearbar > 0 and low < highest[n](low) then
        bar = 0
       
    elsif myclearbar > 0 and high < highest[n](low) then
        bar = -2*high
    endif
    break
   
wend




if myclearbar <= 0 and high < lowest[n](high) then
    bar = -high
   
elsif myclearbar <= 0 and high > lowest[n](high) then
    bar = 0
   
elsif myclearbar <= 0 and low > lowest[n](high) then
    bar = 2*low
   
endif


ma il risultato non è quello sperato perchè l'indicatore "bar" è sempre = 0.


 
Any source

No comments:

Post a Comment