Stop loss fixe par rapport aux derniers plus bas

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #237849 quote
    lannoogeoffrey
    Participant
    Average

    Bonjour à tous.

    J’ai besoin de votre aide pour coder un stop loss, qui lors d’un achat, viendrait se placer sous le dernier plus bas de x périodes mois y pips pour le spread.
    J’essai de le coder avec la formule lowest[10](low), mais je n’arrive pas à faire en sorte qu’il soit fixe. J’aimerais calculer à l’instant de la prise de position, la distance en pips ou points qu’il y a entre le dernier plus bas des x périodes et le prix d’entrée et m’en servir comme distance de sl mais également comme distance de TP pour avoir un RR = 1.

    Merci pour votre retour.

    #237858 quote
    Iván González
    Moderator
    Master

    Voici un exemple :

    // Initial settings
    x=10
    rr=1
    lmin=lowest[x](low)
    
    yourconditions=average[10](close) crosses over average[50](close)
    
    if not longonmarket and yourconditions then
    checkclose=close
    dist=checkclose-lmin
    stoploss=checkclose-dist
    takeprofit=checkclose+rr*dist
    
    BUY 1 CONTRACT AT market
    
    set stop price stoploss
    set target price takeprofit
    endif
    
    graphonprice stoploss coloured("red")
    graphonprice takeprofit coloured("blue")
    #237898 quote
    lannoogeoffrey
    Participant
    Average

    Un tout grand merci.

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

Stop loss fixe par rapport aux derniers plus bas


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by lannoogeoffrey
1 year, 5 months ago.

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