salve a tutti,
stavo provando questa strategia multi timeframe ma non gira…
lo scopo è filtrare i trade sul daily con MACD
sul 4h attraverso le medie mobile a 7 ,12 e 26 periodi
e sul 5 minuti ci dovrebbe essere l’ingresso se le condizioni precedenti sono verificate, in favore del trend, quando il close supera a rialzo il supertrend o a ribasso a seconda del caso.
ma non gira e non capisco dove è l’errore.
grazie in anticipo
stefano
defparam CUMULATEORDERS= false
TIMEFRAME (DAILY,UPDATEONCLOSE)
indicatore= MACD[12,26,9](close)
Long = (indicatore > 0)
Short =(indicatore < 0)
TIMEFRAME(4H,UPDATEONCLOSE)
SMA7= Average[7](close)
SMA12= Average[12](close)
SMA26= Average[26](close)
//CONDIZIONI 4hSHORT
TOPSHORT= SMA26>SMA7
STARTSHORT = SMA12>SMA7 and close<SMA7
if Short then
if TOPSHORT or STARTSHORT then
trade=2
endif
endif
//CONDIZIONI OTTIMALI DI TRADING LONG
STARTLONG= SMA7> SMA12 and close> SMA7
TOPLONG = SMA26<SMA7
if Long then
if STARTLONG or TOPLONG then
trade=1
endif
endif
//TIMEFRAME 5 MIN
TIMEFRAME (DEFAULT)
ST = Supertrend[3.5,10]
c1= close crosses over ST
c2= close crosses under ST
if trade=1 and c1 then
buy 1 contract at market
endif
if trade=2 and C2 then
sell 1 contract at market
endif
Non apre nessuna posizione?
A me sul DAX le ha aperte, prova ad aumentare le unità (io uso 200K, di solito).
avevi ragione, funziona… non è bellissima ma almeno gira. grazie mille roberto