Differents SET STOP et SET PPROFIT

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #158296 quote
    Xavier01
    Participant
    Average

    Bonjour, est ce possible d’établir différents stop et profit selon si l’on est court ou long sur le même code??

    #158302 quote
    Nicolas
    Keymaster
    Master

    Oui, si au moment de passer l’ordre on utilise un SET TARGET PPROFIT et SET STOP PLOSS avec des valeurs différentes (solution la plus simple).

    #158303 quote

    Ici, de cette façon, ils sont différents en pourcentage long et court.

     

    buy 1 contract at market
    set target %profit 1.5
    set Stop %loss 1.5
    
    sellshort 1 contract at market
    set target %profit 1.5
    set stop %loss 1.5
    #158308 quote
    Xavier01
    Participant
    Average

    Pardon Nicolas je ne comprend pas votre réponse.J’ai écrit en fin de mon programme différents stops et profits sur les ordres d’achats et de ventes. Est ce que chacun des différents stop et profits sont bien différenciés dans le programme?

    Quand je backtest soit a l’achat soit a la vente les statistiques me conviennent mais quand je backtest avec les deux en même temps la statistique baisse au dessous de la moyenne.J ai juste un profit un peu plus élevé lorsque je suis a la vente.

    //Ordre d'achat
    IF c5 and c7 THEN
    BUY n CONTRACT AT MARKET
    ENDIF
    //Profits A L'ACHAT
    SET TARGET PPROFIT 140
    SET STOP PLOSS 8
    //Ordre de sortie
    IF c8 THEN
    SELL AT MARKET
    ENDIF
    
    //Ordre de vente
    //IF c6 and c8 THEN
    //SELLSHORT n CONTRACT AT MARKET
    //ENDIF
    //IF c7 THEN
    //EXITSHORT AT MARKET
    //ENDIF
    //Profits a la vente
    //SET TARGET PPROFIT 180
    //SET STOP PLOSS 8
    #158332 quote
    Nicolas
    Keymaster
    Master

    Il faut associer ces niveaux de profit et de stop une seule fois, lorsqu’on passe l’ordre correspondant, donc inclure les instructions SET TARGET et SET STOP dans le bloc conditionnel qui lance l’ordre :

    //Ordre d'achat
    IF c5 and c7 THEN
     BUY n CONTRACT AT MARKET
     //Profits A L'ACHAT
     SET TARGET PPROFIT 140
     SET STOP PLOSS 8
    ENDIF
    
    //Ordre de sortie
    IF c8 THEN
     SELL AT MARKET
    ENDIF
    
    //Ordre de vente
    IF c6 and c8 THEN
     SELLSHORT n CONTRACT AT MARKET
     //Profits a la vente
     SET TARGET PPROFIT 180
     SET STOP PLOSS 8
    ENDIF
    IF c7 THEN
     EXITSHORT AT MARKET
    ENDIF
    
    #158340 quote
    Xavier01
    Participant
    Average

    Merci Super Nicolas

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

Differents SET STOP et SET PPROFIT


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Xavier01 @xavier01 Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Xavier01
5 years, 1 month ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 01/18/2021
Status: Active
Attachments: No files
Logo Logo
Loading...