Bonjour, existe-t-il une stratégie basée sur l’indicateur “Twin Range Filter” dévéloppé par Nicolas ?
Par avance merci
Bonjour,
je me permets de relancer le message car je n’ai pas eu de réponse à ma première requête.
Est ce qu’il existe une stratégie basée sur l’indicateur “Twin Range Filter” dévéloppée par Nicolas ?
J’ai essayé de le faire mais ça ne fonctionne pas, help !!!
//PRC_Twing Range Filter | indicator
//28.03.2023
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//author: colinmck
// --- settings
per1 = 27 //"Fast period"
mult1 = 1.6 //"Fast range"
per2 = 55 //"Slow period"
mult2 = 2 //"Slow range"
// --- end of settings
source = customclose
once wper1 = per1 * 2 - 1
avrng1 = average[per1,1](abs(source - source[1]))
smrng1 = average[wper1,1](avrng1) * mult1
once wper2 = per2 * 2 - 1
avrng2 = average[per2,1](abs(source - source[1]))
smrng2 = average[wper2,1](avrng2) * mult2
smrng = (smrng1 + smrng2) / 2
r = smrng
if source>rngfilt[1] then
if (source-r)<rngfilt[1] then
rngfilt=rngfilt[1]
else
rngfilt=source-r
endif
elsif (source+r)>rngfilt[1] then
rngfilt=rngfilt[1]
else
rngfilt=source+r
endif
if rngfilt > rngfilt[1] then
upward=upward+1
downward=0
endif
if rngfilt < rngfilt[1] then
upward=0
downward=downward+1
endif
longCond = (source > rngfilt and source > source[1] and upward > 0) or (source > rngfilt and source < source[1] and upward > 0)
shortCond = (source < rngfilt and source < source[1] and downward > 0) or (source < rngfilt and source > source[1] and downward > 0)
if longcond then
colorr=0
colorg=255
elsif shortcond then
colorr=255
colorg=0
endif
if colorr=0 and colorr[1]=255 then
drawarrowup(barindex,min(low,rngfilt)-averagetruerange[14]/2) coloured("blue")
endif
if colorr=255 and colorr[1]=0 then
drawarrowdown(barindex,max(high,rngfilt)+averagetruerange[14]/2) coloured("yellow")
endif
return rngfilt coloured(colorr,colorg,0) style(line,2)
Bonjour,
code ci-dessus mis au format du bouton “insert PRT code” pour meilleure lisibilité.
Est ce qu’il existe une stratégie basée sur l’indicateur “Twin Range Filter” dévéloppée par Nicolas ?
Pas à ma connaissance, après avoir consulté ce que retourne le moteur de recherche interne du site.
Dans le post de la library dont voici le lien:
Twin Range Filter
il est indiqué dans le texte: “(…) but there’s still too much noise here to set and forget with bots. Use it as the basis of your own system with additional filtering on top.” – Traduction: il y a trop de bruit pour en faire un robot qui achète automatiquement sur les seuls signaux longcond, shortcond, à utiliser comme base pour vos propres systèmes en y ajoutant vos filtres.
Donc coder un buy en cas de variable longcond vraie et un sell en cas de variable sellcond vraie ne suffira pas, il faut d’autres règles à coder pour filtrer les interventions.
Ci-dessous le code de la stratégie depuis ce code d’indicateur.
defparam cumulateorders=false
//PRC_Twing Range Filter | indicator
//28.03.2023
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//author: colinmck
// --- settings
per1 = 27 //"Fast period"
mult1 = 1.6 //"Fast range"
per2 = 55 //"Slow period"
mult2 = 2 //"Slow range"
// --- end of settings
source = customclose
once wper1 = per1 * 2 - 1
avrng1 = average[per1,1](abs(source - source[1]))
smrng1 = average[wper1,1](avrng1) * mult1
once wper2 = per2 * 2 - 1
avrng2 = average[per2,1](abs(source - source[1]))
smrng2 = average[wper2,1](avrng2) * mult2
smrng = (smrng1 + smrng2) / 2
r = smrng
if source>rngfilt[1] then
if (source-r)<rngfilt[1] then
rngfilt=rngfilt[1]
else
rngfilt=source-r
endif
elsif (source+r)>rngfilt[1] then
rngfilt=rngfilt[1]
else
rngfilt=source+r
endif
if rngfilt > rngfilt[1] then
upward=upward+1
downward=0
endif
if rngfilt < rngfilt[1] then
upward=0
downward=downward+1
endif
longCond = (source > rngfilt and source > source[1] and upward > 0) or (source > rngfilt and source < source[1] and upward > 0)
shortCond = (source < rngfilt and source < source[1] and downward > 0) or (source < rngfilt and source > source[1] and downward > 0)
if longcond and not longonmarket then
buy at market
elsif shortcond and not shortonmarket then
sellshort at market
endif
Merci beaucoup, je vais tester tout ça.
Ce code fonctionne très bien, en revanche j’aimerai le modifier de la façon suivante :
. déclenchement d’un ordre en fonction des critères actuels et mise en place d’un stop loss, je ne veux pas que la stratégie “tourne en boucle”, avec ouverture de la bougie suivante à la fermeture de la précédente.
Par avance, merci.
Pour ajouter un stop sloss de 50 points par exemple:
SET STOP PLOSS 50
et / ou un take profit de 100 points:
SET TARGET PPROFIT 100
Merci beaucoup , je vais tester.