Trading automatique avec “Buy Sell Magical Trend”

Viewing 15 posts - 16 through 30 (of 72 total)
  • Author
    Posts
  • #215531 quote
    jbtrade
    Participant
    New

    Bonjour Nicolas,

    Je cherche à connaitre la distance en temps :

    1) entre le point de croisement et le point de croisement-1

    2) entre le point de croisement-1 et le point de croisement-2

    3) entre le point de croisement-2 et le point de croisement-3

    Je n’arrive pas à le coder.

    Merci pour ton aide

    #215539 quote
    Nicolas
    Keymaster
    Master

    Dans la stratégie ou dans l’indicateur ? Une distance en chandeliers est elle suffisante ?

    #215552 quote
    jbtrade
    Participant
    New

    en effet, je me suis mal exprimé

    oui, c’est le nombre de chandelier

    #215565 quote
    jbtrade
    Participant
    New

    dans l’indicateur

    Une distance en chandeliers est elle suffisante ?  OUI

    #215653 quote
    FXtonio
    Participant
    New

    Bonjour à tous, j’obtiens des bons resultats avec la strat, mais j’aimerais integrer un stop breakeven ,

    est il possible de mettre le sl au prix d’entrée quand on atteint 10 pips de gains?  et ensuite faire suivre le tp tout les 10 pips?

    ci dessous le code:

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = false // Cumul des positions désactivé
    // System closes all orders at 00.00 No new orders allowed until "FLATBEFORE" time
    DEFPARAM FLATBEFORE = 080000
    // Cancel all orders and close all positions at "FLATAFTER" Time
    DEFPARAM FLATAFTER = 171500
    
    // No new orders or enlarging position before
    noEntryBeforeTime = 080000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // No new orders or enlarging positions after
    noEntryAfterTime = 163000
    timeEnterAfter = time < noEntryAfterTime
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = CALL "MAGICAL TREND"[12, 2](close)
    c1 = (close > indicator1)
    
    IF c1 AND timeEnterBefore AND timeEnterAfter THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator2 = CALL "MAGICAL TREND"[12, 2](close)
    c2 = (close < indicator2)
    
    IF c2 AND timeEnterBefore AND timeEnterAfter THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops en targets
    SET STOP ptrailing sl
    Rapport-detaille-TREND-FOLLOW-BOT-Allemagne-40-Cash-5E.png Rapport-detaille-TREND-FOLLOW-BOT-Allemagne-40-Cash-5E.png TREND-FOLLOW-BOT.itf
    #215656 quote
    Nicolas
    Keymaster
    Master

    Pour mettre le stoploss à breakeven on peut utiliser l’instruction SET STOP BREAKEVEN

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = false // Cumul des positions désactivé
    // System closes all orders at 00.00 No new orders allowed until "FLATBEFORE" time
    DEFPARAM FLATBEFORE = 080000
    // Cancel all orders and close all positions at "FLATAFTER" Time
    DEFPARAM FLATAFTER = 171500
    
    // No new orders or enlarging position before
    noEntryBeforeTime = 080000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // No new orders or enlarging positions after
    noEntryAfterTime = 163000
    timeEnterAfter = time < noEntryAfterTime
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = CALL "MAGICAL TREND"[12, 2](close)
    c1 = (close > indicator1)
    
    IF c1 AND timeEnterBefore AND timeEnterAfter and not longonmarket  THEN
    BUY 1 CONTRACT AT MARKET
     be = 0 
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator2 = CALL "MAGICAL TREND"[12, 2](close)
    c2 = (close < indicator2)
    
    IF c2 AND timeEnterBefore AND timeEnterAfter and not shortonmarket  THEN
    SELLSHORT 1 CONTRACT AT MARKET
    be=0
    ENDIF
    
    // Stops en targets
    if be = 0 then 
      set stop breakeven
      be = 1
     else 
      set stop ptrailing 10 
     endif 
    endif
    
    #215660 quote
    phoentzs
    Participant
    Master

    Maintenant, ça commence à être intéressant. C’est quelle unité de temps ?

    #215664 quote
    FXtonio
    Participant
    New

    Genial, merci @Nicolas

    #215693 quote
    jbtrade
    Participant
    New

    Bonjour Nicolas,

    Afin de faire un filtre supplémentaire, je cherche à connaitre la distance en temps (nombre de bougie) :

    1) entre le point de croisement et le point de croisement-1

    2) entre le point de croisement-1 et le point de croisement-2

    3) entre le point de croisement-2 et le point de croisement-3

    afin déterminer la tendance  : est on dans une tendance ou une respiration. cela permettrait aussi de connaitre les niveaux de prix : les plus hauts sont toujours plus haut, … avec le même indicateur

    Je n’arrive pas à le coder.

    Merci pour ton aide

    #215702 quote
    Razz
    Participant
    Master

    Merci pour le partage du système commercial , félicitations résultats impressionnants .

    Magic-Trend.jpg Magic-Trend.jpg
    #215710 quote
    Nicolas
    Keymaster
    Master

    Je pense qu’il y a un soucis avec la mise à breakeven directement à l’entrée du trade, je poste une autre version conforme à la demande ci-dessous (mise à BE après 10 points de gain)

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = false // Cumul des positions désactivé
    // System closes all orders at 00.00 No new orders allowed until "FLATBEFORE" time
    DEFPARAM FLATBEFORE = 080000
    // Cancel all orders and close all positions at "FLATAFTER" Time
    DEFPARAM FLATAFTER = 171500
    
    // No new orders or enlarging position before
    noEntryBeforeTime = 080000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // No new orders or enlarging positions after
    noEntryAfterTime = 163000
    timeEnterAfter = time < noEntryAfterTime
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = CALL "MAGICAL TREND"[12, 2](close)
    c1 = (close > indicator1)
    
    IF c1 AND timeEnterBefore AND timeEnterAfter and not longonmarket  THEN
    BUY 1 CONTRACT AT MARKET
     be = 0 
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator2 = CALL "MAGICAL TREND"[12, 2](close)
    c2 = (close < indicator2)
    
    IF c2 AND timeEnterBefore AND timeEnterAfter and not shortonmarket  THEN
    SELLSHORT 1 CONTRACT AT MARKET
    be=0
    ENDIF
    
    // Stops en targets
    if be = 0 and close-tradeprice>=10*pointsize then 
      set stop breakeven
      be = 1
     else 
      set stop ptrailing 10 
     endif 
    endif
    #215711 quote
    Nicolas
    Keymaster
    Master

    Afin de faire un filtre supplémentaire, je cherche à connaitre la distance en temps (nombre de bougie) :

    J’ai plutôt créé un indicateur qui te donne la moyenne de la durée des X dernières tendances, à voir comment l’exploiter. Evidemment, plus c’est faible, plus on est en range.

    //PRC_BuySell Magic | indicator
    //trend duration average 
    
    // --- settings
    SignalPeriod = 12
    ArrowPeriod = 2
    xTrendDurationAverage = 10
    // --- 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
    t=t+1 //trend count
    $bardiff[t]=barindex-lastbarindex //trend duration in bars
    lastbarindex=barindex
    endif
    
    if trend=-1 and close crosses over ts then
    trend=1
    ts=bbdn
    t=t+1 //trend count
    $bardiff[t]=barindex-lastbarindex //trend duration in bars
    lastbarindex=barindex
    endif
    
    //average of trend duration
    if t>xTrendDurationAverage then
    diff=0
    for i = t downto t-xTrendDurationAverage do
    diff=diff+$bardiff[i]
    next
    trendavg=diff/xTrendDurationAverage
    endif
    
    return trendavg as "average of previous X trend duration"
    

    On pourrait également ajouter une pondération avec la quantité de points de chaque tendance, à étudier..

    jbtrade thanked this post
    trend-duration-average.png trend-duration-average.png
    #215727 quote
    tundercut
    Participant
    Senior

    Bonsoir à tous, j’aimerais savoir pourquoi ça ne marche pas pour moi, j’ai aussi essayé en temps réel, ça m’ouvre la position mais la ferme tout de suite au bout de 3-4 secondes, quelqu’un peut-il m’aider ? Merci.

    Rapporto-dettagliato-ProBacktest-TREND-FOLLOW-BOT-EUR-USD-Mini.png Rapporto-dettagliato-ProBacktest-TREND-FOLLOW-BOT-EUR-USD-Mini.png
    #215732 quote
    GraHal
    Participant
    Master

    le ferme tout de suite après 3-4 secondes,

    C’est parce que le Trailing Stop est si proche du prix (7 points ?) et donc > 60% des trades se clôturent > quelques secondes et < 2 barres à perte.

    J’ai exécuté 3 versions sur Demo Live tout l’après-midi et après 53 échanges, une version est toujours à – 107 £.

    Les 3 versions ont montré une excellente courbe d’équité après optimisation sur backtest. Je suppose que nous devons être patients jusqu’à ce que les bons mouvements de prix correspondent à la stratégie / aux paramètres ?

    Est-ce que quelqu’un fait des bénéfices sur la course en direct ?

    #215733 quote
    jbtrade
    Participant
    New

    Merci, je vais le tester demain

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

Trading automatique avec “Buy Sell Magical Trend”


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
FXtonio @fxtonio Participant
Summary

This topic contains 71 replies,
has 17 voices, and was last updated by Dams3164
1 year, 8 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 04/25/2023
Status: Active
Attachments: 11 files
Logo Logo
Loading...