problème de trailing stop en compte réel

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #108655 quote
    lolotime
    Participant
    Junior

    Bonjour à tous

    j’ai codé une stratégie combinant un trailing stop et un breakeven. celle fonctionne très bien sur la plateforme démo en paper trading mais refuse de se lancer en compte réel en risque limité avec stop garanti.  Est-ce que quelqu’un peut me dire pourquoi ?

    Merci d’avance pour votre réponse

    #108657 quote
    lolotime
    Participant
    Junior
    // Valeur du Stop SUiveur
    DEFPARAM CumulateOrders = False
    
    startBreakeven = 9 //how much pips/points in gain to activate the breakeven function?
    PointsToKeep = 2 //how much pips/points to keep in profit above of below our entry price when the breakeven is activated (beware of spread)
    Seuil = 20
    stopgaranti = 70
    c1=rsi[60](close) crosses over 50
    c2=rsi[60](close) crosses under 50
     
    // Condition prise de position achat
    IF not onmarket and c1 THEN
    BUY 1 CONTRACT AT MARKET
    TRAIL= Close - Stopgaranti
    ENDIF
     
    // Condition prise de position vente
    IF not onmarket and c2 THEN
    sellshort 1 CONTRACT AT MARKET
    TRAIL= Close + Stopgaranti
    ENDIF
    
    
    // trailing stop ***********************************************************************************************
    // trailing achat ***********************************************
    // 1er mouvement trailing achat
    if TRAIL= Close - Stopgaranti and close-seuil>tradeprice then
    trail = close - Seuil
    endif
    // Mise à jour du cours achat
    IF longonmarket and close-seuil>tradeprice and close-Seuil > trail THEN
    trail = close - Seuil
    ENDIF
     
    // trailing vente ***********************************************
    // 1er mouvement trailing vente
    if TRAIL= Close + Stopgaranti and close+seuil<tradeprice then
    trail = close + Seuil
    endif
    // Mise à jour du cours de vente
    IF shortonmarket and close+seuil<tradeprice and close+Seuil < trail THEN
    trail = close + Seuil
    ENDIF
    
    
    
    
    // breakeven****************************************************************************************
    //reset the breakevenLevel when no trade are on market
    IF NOT ONMARKET THEN
    breakevenLevel=0
    ENDIF
    
    // --- BUY SIDE ---
    //test if the price have moved favourably of "startBreakeven" points already
    IF LONGONMARKET AND close-tradeprice(1)>=startBreakeven*pipsize THEN
    //calculate the breakevenLevel
    breakevenLevel = tradeprice(1)+PointsToKeep*pipsize
    ENDIF
    
    //place the new stop orders on market at breakevenLevel
    IF breakevenLevel>0 THEN
    SELL AT breakevenLevel STOP
    ENDIF
    // --- end of BUY SIDE ---
    
    // --- sellshort SIDE ---
    //test if the price have moved favourably of "startBreakeven" points already
    IF shortONMARKET AND tradeprice(1)-close>=startBreakeven*pipsize THEN
    //calculate the breakevenLevel
    breakevenLevel = tradeprice(1)-PointsToKeep*pipsize
    ENDIF
    
    //place the new stop orders on market at breakevenLevel
    IF breakevenLevel>0 THEN
    exitshort AT breakevenLevel STOP
    ENDIF
    // --- end of sellshort SIDE ---
    
    // Ordre de vente STOP achat
    IF LONGONMARKET THEN
    SELL AT TRAIL STOP
    SET STOP PLOSS 75
    ENDIF
     
    // order de vente stop vente
    if shortonmarket then
    exitshort at trail stop
    SET STOP PLOSS 75
    endif
    
    #108658 quote
    Nicolas
    Keymaster
    Master

    Quelle est le message d’erreur obtenu lors de l’envoi dans ProOrder svp ?

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

problème de trailing stop en compte réel


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
lolotime @lolotime Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Nicolas
6 years, 5 months ago.

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