Citazione Originariamente Scritto da Thalos Visualizza Messaggio
Ciao
Sto' tentando di portare su BeeTrader questo codice da Easy Language a Easy Script, del TS BreakOut Dinamico, ma non ci riesco nella traduzione, in quanto i parametri sono diversi e mi da' continuamente errori:

Il Ts si basa su questo concetto:
Esso si basa sulla stima della Volatilita' calcolata attraverso la deviazione standard a 30 periodi (Modificabile) dal cui valore viene ricavato un Delta successivamente aggiunto o sottratto al valore di un canale dinamico che misura la distanza tra massimi e minimi degli ultimi 20 periodi (EntryLB).
Il segnale di acquisto Long scatta quando i prezzi superano il massimo piu' alto degli ultimi EntryLB periodi, dove EntryLB e' il massimo valore tra 20 e l' eventuale allungamento del canale derivante dall' incremento della volatilita'.
Il Segnale di vandita Short scatta invece quando i prezzi scendono al di sottodel minimo piu' basso degli ultimi EntryLB periodi.
Il "Canale" per le uscite e' invece piu' stretto con la variabile EntryLB che viene dimezzata.
Poi c'e' il solito Filtro di Tempo.


Codice EasyLanguage:

Inputs: MaxLB(60), MinLB(20);

Vars: HistVol(0), YestHistVol(0), DeltaHistVol(0),
EntryLB(0),
ExitLB(0), YestEntryLB(0);

YestHistVol = HistVol;
HistVol = StdDev(C, 30);
DeltaHistVol = (HistVol - YestHistVol) / Histvol;

if CurrentBar = 1 Then

EntryLB = 20;
YestEntryLB = EntryLB;
EntryLB = YestEntryLB * (1 + DeltaHistVol);
EntryLB = MaxList(EntryLB, MinLB);
EntryLB = MinList(EntryLB, MaxLB);
ExitLB = EntryLB * 0.5;

If time > 1000 and Time < 1700 Then begin

Buy Tomorrow at Highest(High, EntryLB) Stop;
Sell Tomorrow at Lowest(Low, EntryLB) Stop;
End;

Ovviamente a questo listato possiamo aggiungere il Trailing Stop
e lo Stop Loss per il nostro Money Management

Vi ringrazio se potete darmi una mano nella traduzione in Easy Script semplificato, ci sto' sbattendo la testa inutilmente...

Poi sicuramente fara' un figurone nei TS da prendere ad esempio di Bee, su Traderstation da' dei buonissimi risultati..
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)