Trading automatique avec “Buy Sell Magical Trend”

Viewing 15 posts - 1 through 15 (of 72 total)
  • Author
    Posts
  • #213731 quote
    FXtonio
    Participant
    New

    Bonjour à tous,

    je viens de découvrir l’indicateur “Buy Sell Magical Trend” posté par @Nicolas, je l’ai testé et les résultats sont assez surprenant en m15 (74% de winrate en 1 semaine sur eur/usd)

    Je ne  sais pas programmer mais est il possible d’automatiser une stratégie avec cet indicateur?

    Bonne journée à tous 🙂

    #213739 quote
    robertogozzi
    Moderator
    Master

    Ne doublez pas les messages. Posez votre question une seule fois et dans un seul forum. Tous les messages doubles seront supprimés de toute façon, donc poster plusieurs fois la même question vous fera perdre votre propre temps et ne vous donnera pas de réponse plus rapidement. La double publication crée juste de la confusion dans les forums.

    Merci 🙂

    #213986 quote
    FXtonio
    Participant
    New

    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)

    #214441 quote
    Jabiru
    Participant
    Average

    Bonjour,

     

    Voici le code:

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = CALL "MAGICAL TREND"(close)
    c1 = (close > indicator1)
    
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position acheteuse
    indicator2 = CALL "MAGICAL TREND"(close)
    c2 = (close < indicator2)
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator3 = CALL "MAGICAL TREND"(close)
    c3 = (close < indicator3)
    
    IF c3 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position en vente à découvert
    indicator4 = CALL "MAGICAL TREND"(close)
    c4 = (close > indicator4)
    
    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF

     

     

    Attention, il faut bien que tu enregistres l’indicateur avec le même nom :”MAGICAL TREND”.

    Ps: code créé très simplement avec la fonction création simplifiée.

    Nicolas and ssopiak thanked this post
    #214834 quote
    FXtonio
    Participant
    New

    Bonjour, merci beaucoup 🙂 🙂

    #214976 quote
    tundercut
    Participant
    Senior

    Bonjour, j’ai essayé de faire un backtest sur différentes tranches de temps mais ça n’ouvre aucune position, est-ce que quelqu’un peut m’aider ?Merci.

    #214977 quote
    MartinB
    Participant
    New

    Dear Jabiru, thanks for the code.

    When I run your code, it is only opening a buy position and maintain this position, despite new signals.

    Did I do something wrong here?

    I copied your code in the backtesting module from Prorealtime (IG) and kept the name from the indicator and code equal “MAGICAL TREND”

    Thanks for your reply

    Martin

    Cher Jabiru, merci pour le code. Lorsque j’exécute votre code, il ne fait qu’ouvrir une position d’achat et maintenir cette position, malgré de nouveaux signaux. Ai-je fait quelque chose de mal ici? J’ai copié votre code dans le module de backtesting de Prorealtime (IG) et j’ai gardé le nom de l’indicateur et le code égal à “MAGICAL TREND” Merci pour votre réponse Martin

    #214978 quote
    MartinB
    Participant
    New

    Dear Jabiru,

    I programmed the Magical Trend in the wizard mode again and it is working now.

    Find my code below:

    Cher Jabiru, j’ai reprogrammé la tendance magique en mode assistant et cela fonctionne maintenant. Trouvez mon code ci-dessous :

    Dear Jabiru,

    // 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 = 090000
    // Cancel all orders and close all positions at "FLATAFTER" Time
    DEFPARAM FLATAFTER = 171500
    
    // No new orders or enlarging position before
    noEntryBeforeTime = 090000
    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 pLOSS 7
    SET TARGET pPROFIT 14

     

    #214981 quote
    robertogozzi
    Moderator
    Master

    @MartinB

    Publiez uniquement dans la langue du forum dans laquelle vous publiez. Par exemple, l’anglais uniquement dans les forums anglophones et le français uniquement dans les forums francophones.

    Merci 🙂

    #214984 quote
    MartinB
    Participant
    New

    Cher Roberto,

    Désolé, je me souviendrai

    Salutation.

    Martin

    #215055 quote
    FXtonio
    Participant
    New

    Bonjour, Merci pour toutes les informations 🙂

    ci joint le code  avec mes parametrages: fonctionne très bien sur eur/usd en time frame H3  j’ai juste remplacer les tp/sl par un sl suiveur à 10 pips

    J’aurais une question, est il possible d’améliorer les points d’entrées en faisant en sorte que le point d’entrée soit lorsque la flêche apparait ?

    Bonne journée.

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    timeEnterBefore = time >= 080000
    timeEnterAfter = time <= 180000
    
    //definition du stop loss
    set stop ptrailing 10
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = CALL "MAGICAL TREND"(close)
    c1 = (close > indicator1)
    
    IF c1 THEN
    BUY 5 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator3 = CALL "MAGICAL TREND"(close)
    c3 = (close < indicator3)
    
    IF c3 THEN
    SELLSHORT 5 CONTRACT AT MARKET
    endif
    #215063 quote
    Nicolas
    Keymaster
    Master

    Les prises de positions sont déjà de ce type, le changement de tendance s’observe à fin de chandelier, on confirme l’ordre et il est envoyé à l’open suivant.

    On peut toujours prendre position à l’intérieur de la bougie, mais cela ne signifie par que le signal sera toujours le même à sa clôture.

    #215065 quote
    FXtonio
    Participant
    New

    Merci Nicolas 🙂

    j’essaye d’améliorer le système, en manuel j’obtiens a peu près 60% de trade gagnant en scalp m1, mais en automatique je ne comprend pas les point d’entrés du systeme, il rentre “en retard” 2 à 3 bougies après le signal ………

    #215067 quote
    Nicolas
    Keymaster
    Master

    J’ai recodé la stratégie avec l’indicateur à l’intérieur de celle-ci :

    //PRC_BuySell Magic | strategy
    //Nicolas @ 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 ts then 
    if close crosses under ts then
    sellshort at market 
    trend=-1
    ts=bbup
    endif
    
    if  close crosses over ts then
    buy at market 
    trend=1
    ts=bbdn
    endif
    endif 
    
    graphonprice ts 
    
    
    #215071 quote
    FXtonio
    Participant
    New

    Magnifique, merci Nicolas 🙂

Viewing 15 posts - 1 through 15 (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...