Ma question et que pensez vous de de mon code ?
(l'indicateur)
// SMA Cross (Eq)
// S,L: 3 to 31
//c1 = shortMA >= longMA
//c2 = shortMA < longMA
shortMA = Average[3](close)
longMA = Average[31](close)
c1 = shortMA >= longMA
c2 = shortMA < longMA
if barindex > 0 then
if c1[1] then
thisBarGain = close - open
endif
if c2[1] then
thisBarGain = -(close - open)
endif
if c1[2] then
gapGain = open - close[1]
endif
if c2[2] then
gapGain = - (open - close[1])
endif
EQ = EQ[1] + thisBarGain + gapGain
endif
return EQ AS "SMA Cross (Eq)"
(la stratégie)
//Stratgie
// S,L: 3 a 31
DEFPARAM CUMULATEORDERS = false
DEFPARAM flatafter = 172900
shortMA = Average[3](close)
longMA = Average[31](close)
c1 = shortMA >= longMA
c2 = shortMA < longMA
if c1 and not longonmarket then
buy 10000 CONTRACTS AT market
endif
if c2 and not shortonmarket then
sellshort 10000 CONTRACTS AT market
endif
(testé sur le class 3 milk en journalier)
Dite moi pour vous ce qui ne va pas pour vous, car moi je n'arrive pas a lui faire prendre plus de position.
Cordialement