Twin Range Filter Statégy

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #220226 quote
    RICOU
    Participant
    New

    Bonjour, existe-t-il une stratégie basée sur l’indicateur “Twin Range Filter” dévéloppé par Nicolas ?

    Par avance merci

    #220523 quote
    RICOU
    Participant
    New

    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)
    #220561 quote
    JC_Bywan
    Moderator
    Master

    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.

    #220565 quote
    Nicolas
    Keymaster
    Master

    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
    
    
    #220609 quote
    RICOU
    Participant
    New

    Merci beaucoup, je vais tester tout ça.

    #220610 quote
    RICOU
    Participant
    New

    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.

    #220694 quote
    Nicolas
    Keymaster
    Master

    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
    #220791 quote
    RICOU
    Participant
    New

    Merci beaucoup , je vais tester.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Twin Range Filter Statégy


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
RICOU @ricou Participant
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by RICOU
2 years, 5 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 09/02/2023
Status: Active
Attachments: No files
Logo Logo
Loading...