Bonjour je suis nul en programmation.
Je cherche à backtester cette stratégie:
Achat si bougie heikin-ashi casse à la hausse le doji précédent
Vente si cassure croisement à la baisse de la mm10 (close)
stop loss sous le doji
Pouvez vous m’aider svp ?
Holà. Ici, vous avez un exemple pour travailler sur lui.
//------------------------------------//
// Heikin Ashi
//------------------------------------//
once haopen=open
haclose=(open+close+high+low)/4
if barindex> 0 then
haopen=(haopen+haclose[1])/2
endif
halow=min(low,min(haclose,haopen))
hahigh=max(high,max(haclose,haopen))
//------------------------------------//
// Doji
//------------------------------------//
irange=hahigh-halow
body=abs(haclose-haopen)
doji = body < irange*0.15
//------------------------------------//
// Setup
//------------------------------------//
slpip=10
if not onmarket and doji then
stoploss=halow-slpip*pipsize
buy 1 contract at hahigh stop
set stop price stoploss
endif
if onmarket and close crosses under average[10](close) then
sell at market
endif
graphonprice average[10](close) coloured("blue")
graphonprice stoploss coloured("red")