Buongiorno,
sono un nuovo utilizzatore del prorealtime e mi sto dedicando ai sistemi automatici.
Ho visto che la creazione semplificata non riconosce le HA.
Vorrei creare un semplice sistema su candele haiken ashi dove compro alla prima verde senza lower shadow e vendo alla prima rossa qualunque e viceversa per lo short. Sarebbe utile anche un indicatore che restituisce il colore delle HA.
Qualcuno può aiutarmi? Grazie in anticipo.
P.S.: Ho notato anche nella demo, in qualunque sistema, c’è un ritardo di una candela, c’è anche in versione real?
Ecco:
// HA - definizione candele Heikin-Ashi
//
xOpen = open
xClose = (open + close + high + low) / 4
if barindex > 0 then
xOpen = (xOpen[1] + xClose[1]) / 2
endif
xLow = min(low,min(xClose,xOpen))
xHigh = max(high,max(xClose,xOpen))
//xTypic = (xHigh + xLow + xClose) / 3
//xMed = (xHigh + xLow) / 2
//xRange = xHigh - xLow
Verde = xClose > xOpen
Rossa = xClose < xOpen
OmbraSup = xHigh - max(xOpen,xClose)
OmbraInf = min(xOpen,xClose) - xLow
Lcond = Verde and (OmbraInf = 0) and Not OnMarket
Scond = Rossa and (OmbraSup = 0) and Not OnMarket
If LCond then
Buy 1 contract at Market
Elsif Scond then
Sellshort 1 contract at Market
Endif
If LongOnMarket and Rossa then
Sell at Market
Endif
If ShortOnMarket and Verde then
Exitshort at Market
Endif
Le strategie vengono sempre eseguite alla chiusura di ogni barra, per cui la freccia d’ingresso la vedi sulla barra che si apre, ma non c’è nessun ritardo,