Citazione Originariamente Scritto da maxmax68 Visualizza Messaggio
Salve a tutti,
grazie alla nuova funzione di beeTrader e all'idea di Apo
ecco tradotto il codice postato da Thalos.
L'ho tradotto sia come indicatore per dare l'immagine
del canale dinamico utilizzato per il signal, sia come segnale per la strategia.
Manca da inserire Stoploss e TrailingStop.
Si potrebbe inoltre snellire la parte di codice
relativo alle porzioni Sell, ExitLong e ExitShort
eliminando le linee inutili,
ma io per comodità mi sono limitato ad un copia-incolla.
Scusate la forma ma non ho ancora imparato a delimitare il codice.
Come si fa ?
Saluti
Massimo
#
# Indicatore Volatilità suggerito da Thalos
#
INPUTS: @MaxLB(60), @MinLB(20)
SET HistVol=SDV(CLOSE, 30, 1, SIMPLE)+0.000001
SET YestHistVol = REF(HistVol, 1)
SET DeltaHistVol = (HistVol - REF(HistVol, 1))/HistVol
SET EntryLB = BARLOOP (20 , 1, MULTIPLY , (1 + DeltaHistVol),@MinLB, @MaxLB)
SET ExitLB = EntryLB *0.5
SET EntryHigh = MAX(HIGH, EntryLB)
SET EntryLow = MIN(LOW, EntryLB)
SET ExitHigh = MAX(HIGH, ExitLB)
SET ExitLow = MIN(LOW, ExitLB)
SET PLOT1 = EntryHigh
SET PLOT2 = EntryLow
SET PLOT3 = ExitHigh
SET PLOT4 = ExitLow

#
# Signal Volatilità suggerito da Thalos BuyScript
#
INPUTS: @MaxLB(60), @MinLB(20)
SET HistVol=SDV(CLOSE, 30, 1, SIMPLE)+0.000001
SET YestHistVol = REF(HistVol, 1)
SET DeltaHistVol = (HistVol - REF(HistVol, 1))/HistVol
SET EntryLB = BARLOOP (20 , 1, MULTIPLY , (1 + DeltaHistVol),@MinLB, @MaxLB)
SET ExitLB = EntryLB *0.5
SET EntryHigh = MAX(HIGH, EntryLB)
SET EntryLow = MIN(LOW, EntryLB)
SET ExitHigh = MAX(HIGH, ExitLB)
SET ExitLow = MIN(LOW, ExitLB)
SET Cond1= TIME >1000 AND TIME <1700
COND1 AND CLOSE > REF(EntryHigh, 1)
#
# Signal Volatilità suggerito da Thalos SellScript
#
SET HistVol=SDV(CLOSE, 30, 1, SIMPLE)+0.000001
SET YestHistVol = REF(HistVol, 1)
SET DeltaHistVol = (HistVol - REF(HistVol, 1))/HistVol
SET EntryLB = BARLOOP (20 , 1, MULTIPLY , (1 + DeltaHistVol),@MinLB, @MaxLB)
SET ExitLB = EntryLB *0.5
SET EntryHigh = MAX(HIGH, EntryLB)
SET EntryLow = MIN(LOW, EntryLB)
SET ExitHigh = MAX(HIGH, ExitLB)
SET ExitLow = MIN(LOW, ExitLB)
SET Cond1= TIME >1000 AND TIME <1700
COND1 AND CLOSE < REF(EntryLow, 1)
#
# Signal Volatilità suggerito da Thalos LongExitScript
#
SET HistVol=SDV(CLOSE, 30, 1, SIMPLE)+0.000001
SET YestHistVol = REF(HistVol, 1)
SET DeltaHistVol = (HistVol - REF(HistVol, 1))/HistVol
SET EntryLB = BARLOOP (20 , 1, MULTIPLY , (1 + DeltaHistVol),@MinLB, @MaxLB)
SET ExitLB = EntryLB *0.5
SET EntryHigh = MAX(HIGH, EntryLB)
SET EntryLow = MIN(LOW, EntryLB)
SET ExitHigh = MAX(HIGH, ExitLB)
SET ExitLow = MIN(LOW, ExitLB)
SET Cond1= TIME >1000 AND TIME <1700
CLOSE < REF(ExitLow, 1)

#
# Signal Volatilità suggerito da Thalos ShortExitScript
#
SET HistVol=SDV(CLOSE, 30, 1, SIMPLE)+0.000001
SET YestHistVol = REF(HistVol, 1)
SET DeltaHistVol = (HistVol - REF(HistVol, 1))/HistVol
SET EntryLB = BARLOOP (20 , 1, MULTIPLY , (1 + DeltaHistVol),@MinLB, @MaxLB)
SET ExitLB = EntryLB *0.5
SET EntryHigh = MAX(HIGH, EntryLB)
SET EntryLow = MIN(LOW, EntryLB)
SET ExitHigh = MAX(HIGH, ExitLB)
SET ExitLow = MIN(LOW, ExitLB)
SET Cond1= TIME >1000 AND TIME <1700
CLOSE > REF(ExitHigh, 1)


Ciao Massimo,
complimenti davvero.

Allora per delimitare il codice puoi fare così: premi questo bottone :

Clicca sull'immagine per ingrandirla

Nome: unoe.jpg
Visite: 15
Dimensione: 14.8 KB
ID: 12415

appena lo premi nel testo vengono inseriti questi tag:

Nome: due.jpg
Visite: 241
Dimensione: 1.7 KB


Quello che ci scrivi dentro viene renderizzato con il codice.


saluti,
Marco Bosco