EMA en unité de temps 5mins

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #86508 quote
    PinkybouhPinkybouh
    Participant
    Junior

    Bonjour,

    Pourriez vous m’aider à ajouter un niveau de stop loss fixe (si la position est en perte de x pips: sell) (X étant à définir)

    Voici le code que j’utilise : UT 5mins sur le DAX avec des EMA (plus réactif pour du court terme à mon sens)

    DEFPARAM CumulateOrders = false
    m= strategyprofit[0]
    mm3= ExponentialAverage[55]
    mm2= ExponentialAverage[26]
    mm1= ExponentialAverage[9]
    n=(m/1000)+2
    if mm1<mm2 and mm2<mm3 then
    sellshort n contract at market
    endif
    
    if mm1>mm2 and mm2>mm3 then
    buy n contract at market
    endif
    
    
    #86512 quote
    NicolasNicolas
    Keymaster
    Legend

    Pour placer un STOPLOSS il faut simplement utiliser l’instruction:

    SET STOP PLOSS x

    x pouvant être renseigné en tant que variable comme ceci:

    x = 15 //15 points de stoploss
    #86527 quote
    PinkybouhPinkybouh
    Participant
    Junior

    Merci j’ai modifié comme ceci,

    Néanmoins un dernier point, est ce possible de definir une variable max au cumulateorders si il est actif ? (j’ai essayé avec un max) mais je ne pense pas que cela est juste ni judicieux de plus

    DEFPARAM CumulateOrders = true
    m= strategyprofit[0]
    mm3= ExponentialAverage[100]
    mm2= ExponentialAverage[27]
    mm1= ExponentialAverage[7]
    n=(m/10000)+0.1 and MAX(0,1)
    if mm1<mm2 and mm2<mm3 then
    sellshort n contract at market
    SET STOP %Loss x
    x=0.33
    SET TARGET $PROFIT y
    y=69
    endif
    
    if mm1>mm2 and mm2>mm3 then
    buy n contract at market
    SET TARGET $PROFIT y
    SET STOP %Loss x
    endif
    #86649 quote
    NicolasNicolas
    Keymaster
    Legend

    > Pour la clarté des messages sur les forums de ProRealCode, merci d’utiliser le bouton “insert PRT code” pour séparer la partie texte de la partie code, merci ! <<

    Il faut utiliser COUNTOFLONGSHARES et créer une condition avec celui-ci.

Viewing 4 posts - 1 through 4 (of 4 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

EMA en unité de temps 5mins


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Pinkybouh @pinkybouh Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by NicolasNicolas
7 years, 10 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 12/07/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...