Bonjour à tous,
je souhaiterais integrer l’indicateur suivant dans une stratégie automatique:
Conditions d’achat: prendre un achat quand la flêche verte apparait sous le prix (bougie suivante)
conditions de vente: prendre une vente quand la flêche rouge apparait au dessus du prix (bougie suivante)
Merci d’avance pour vos réponses.
//PRC_BuySell Magic | indicator
//17.04.23
//Nicolas @ http://www.prorealcode.com
//Sharing ProRealTime knowledge
// — settings
SignalPeriod = 12
ArrowPeriod = 2
// — end of settings
bbup = average[signalperiod]+std[signalperiod]*arrowperiod
bbdn = average[signalperiod]-std[signalperiod]*arrowperiod
if ts=0 then
if close crosses over bbup then
ts=bbdn
trend=1
elsif close crosses under bbdn then
ts=bbup
trend=-1
endif
endif
if trend=1 then
ts=max(ts,bbdn)
elsif trend=-1 then
ts=min(ts,bbup)
endif
if trend=1 and close crosses under ts then
trend=-1
ts=bbup
r=255
g=0
drawarrowdown(barindex,ts) coloured(“red”)
drawsegment(startbar,startts,barindex,ts) style(dottedline2) coloured(“blue”)
startbar=barindex
startts=ts
endif
if trend=-1 and close crosses over ts then
trend=1
ts=bbdn
r=0
g=255
drawarrowup(barindex,ts) coloured(“lime”)
drawsegment(startbar,startts,barindex,ts) style(dottedline2) coloured(“blue”)
startbar=barindex
startts=ts
endif
return ts coloured(r,g,0) style(dottedline,2)