stop loss et perte max

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #135916 quote
    stassin stephanestassin stephane
    Participant
    New

    Bonsoir,

    J’ ai un code tout simple qui fonctionne sur le dax30… seulement lorsqu’il a un gros gap ou une grosse bougie je perd beaucoup. Y a t il moyen de programmer le code pour qu’il y ait une perte max?? J’ai mis un stop loss à 30 points mais parfois je perds beaucoup plus car ça calcule sur la fermeture de la bougie…il me faudrait un stop à la même hauteur que mon stop loss quoiqu’il arrive

    D’avance merci

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions activé
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = ExponentialAverage[7](close)
    indicator2 = ExponentialAverage[20](close)
    c1 = (indicator1 CROSSES OVER indicator2)
    
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator3 = ExponentialAverage[7](close)
    indicator4 = ExponentialAverage[20](close)
    c2 = (indicator3 CROSSES UNDER indicator4)
    
    IF c2 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops et objectifs
    SET STOP pLOSS 30
    #135963 quote
    NicolasNicolas
    Keymaster
    Legend

    Merci de respecter les règles de publication lu et accepté, petit rappel :

    • Postez votre nouveau sujet dans le forum correct : ProOrder: uniquement les sujets sur les stratégies.
    • Utilisez toujours le bouton “Insert PRT Code” lorsque vous mettez du code dans vos messages pour faciliter la lecture par les autres.

    Le stoploss est placé à 30 points du point d’entrée. Lors d’un gap la perte peut être en effet plus importante. Si le courtier propose un stop garanti, c’est peut être une bonne solution de l’utiliser ?

    A essayer toutefois avec un order conditionnel comme ceci :

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions activé
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = ExponentialAverage[7](close)
    indicator2 = ExponentialAverage[20](close)
    c1 = (indicator1 CROSSES OVER indicator2)
    
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    sell at close-30*pipsize stop
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    indicator3 = ExponentialAverage[7](close)
    indicator4 = ExponentialAverage[20](close)
    c2 = (indicator3 CROSSES UNDER indicator4)
    
    IF c2 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    exitshort at close+30*pipsize stop 
    ENDIF
    
    if longonmarket then 
     sell at tradeprice-30*pipsize stop
    elsif  shortonmarket then 
     exitshort at tradeprice+30*pipsize stop 
    endif
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

stop loss et perte max


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
6 years, 3 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 06/14/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...