Range filter Buy and sell – sortie lors du changement de couleur

Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts
  • #257637 quote
    finplus
    Participant
    Master

    1 heure.

    #257641 quote
    finplus
    Participant
    Master

    le timeframe est 1 heure.

    #258050 quote
    finplus
    Participant
    Master

    Bonsoir,

    je remonte une dernière fois mon problème. Peut-être qu’il n’y a pas d’explications.

    Merci.

    #258054 quote
    Nicolas
    Keymaster
    Master

    Je regarderai à cela dès lundi. Si pas de nouvelles, tu me relance. Bon weekend.

    finplus thanked this post
    #258105 quote
    Nicolas
    Keymaster
    Master

    Je vois beaucoup de sujets et de codes sur l’achat et vente sur l’indicateur Range Filter dans la recherche:

    Search

    Avant d’aller plus loin, peut être trouveras tu ton bonheur ?

    N’hésitez pas à utiliser l’outil de recherche du site, il est devenu très performant ! 😉

    finplus thanked this post
    #258140 quote
    finplus
    Participant
    Master

    Merci. Je vais regarder.

    #258151 quote
    Nicolas
    Keymaster
    Master

    Si problème, repost à la suite et je t’aiderai.

    #258365 quote
    finplus
    Participant
    Master

    Bonjour Nicolas,

    j’ai parcouru l’ensemble des sujets listés sur ce thème dans la fonction “search” (qui est en effet très performant). Un indicateur pourrait être utilisé “AdaptTS with adx filter”. Mais je n’ai pas trouvé pour mon problème de sortie lors du changement de couleur du ruban.

    Donc une petite aide éventuelle serait appréciée.

    merci.

    bon week-end.

    Philippe.

    #258409 quote
    Nicolas
    Keymaster
    Master

    Tu trouveras ci-dessous le code de la stratégie pour prendre position au passage du bleu au rouge ou inversement avec l’indicateur trend filter:

    defParam cumulateorders = false
    
    xClose = (Open+High+Low+Close)/4
    // Source
    src = xclose
    // Sampling Period
    // Settings for 5min chart, BTCUSDC. For Other coin, change the paremeters
    // per = defval=100, minval=1, "Sampling Period"
    // Range Multiplier
    // mult = defval=3.0, minval=0.1, "Range Multiplier"
    
    PER = 100
    MULT = 3
    
    // Smooth Average Range
    wper = per*2 -1
    avrng = exponentialaverage[per](abs(src-src[1]))
    smrng = mult * exponentialaverage[wper](avrng)
    
    // Range Filter
    
    rngfilt = src
    If src > rngfilt[1] then
       If rngfilt[1] > src-smrng then
          rngfilt = rngfilt[1]
       Else
          rngfilt = src-smrng
       endif
       
    elsif rngfilt[1] < src+smrng then
       rngfilt = rngfilt[1]
    else
       rngfilt = src+smrng
       
    endif
    filt = rngfilt
    
    // Filter Direction
    upward = 0
    
    If filt > filt[1] then
       upward = upward[1]+1
    elsif filt < filt[1] then
       upward = 0
    else
       upward = upward[1]
    endif
    
    downward = 0
    
    If filt < filt[1] then
       downward = downward[1]+1
    elsif filt > filt[1] then
       downward = 0
    else
       downward = downward[1]
    endif
    
    // Target Bands
    hband = filt + smrng
    lband = filt - smrng
    
    //// Zone de couleurs : selon des conditions
    ////////////////////////////////////////////////////////////////////////////
    
    mbTendance = (Average[3](filt) + filt)/2
    if mbTendance > mbTendance[1] then
       red=0
       green=0
       blue=255
    elsif mbTendance < mbTendance[1] then
       red=255
       green=0
       blue=0
    endif
    
    longCondition = blue>0 and blue[1]=0
    shortCondition = red>0 and red[1]=0
    
    //Alerts
    If longCondition then
       buy 1 contract at market
    endif
    If shortCondition then
       sellshort 1 contract at market
    endif
    
    
    finplus thanked this post
    #258427 quote
    finplus
    Participant
    Master

    Bonsoir Nicolas,

    merci. Juste une petite remarque : le changement de couleur du ruban est un signal de sortie (et non pas d’entrée en position).

    Merci.

Viewing 10 posts - 16 through 25 (of 25 total)
  • You must be logged in to reply to this topic.

Range filter Buy and sell – sortie lors du changement de couleur


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
finplus @finplus Participant
Summary

This topic contains 24 replies,
has 5 voices, and was last updated by finplus
1 month, 3 weeks ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 01/22/2026
Status: Active
Attachments: 3 files
Logo Logo
Loading...