Take profit dinamico

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #111885 quote
    drfbdrfb
    Participant
    Average

    Buongiorno.

    E’ possibile rendere il take profit dinamico? Nel senso che, esiste un comando con il quale, una volta entrati a mercato con qualsiasi tipo di condizione (i parametri sono solo di esempio)

    sl= 3
    tp= 9
    
    if c1  then
    buy 1 contract at market
    endif
    
    SET STOP pLOSS sl
    SET TARGET pPROFIT tp

    si possa spostare sia il tp che lo sl di x pips se il mercato ci è favorevole?

     

    Ho trovato qualche esempio in rete, ma non ho capito molto bene come farlo.

    Grazie!!!!

    #111886 quote
    Ciao hai due possibilità:
    una in percentuale.
    PFL = 1
    PFSL = 1
    PFS = 1
    PSSS = 1
    
    if longonmarket then
    set target %profit PFL
    endif
    if longonmarket then
    set Stop %loss PFSL
    endif
    
    if shortonmarket then
    set target %profit PFS
    endif
    if shortonmarket then
    set stop %loss PSSS
    endif
    
    In questo esempio differenziati long/Short
    
    Il secondo modo che si adatta alla volatilità.
    
    ATRL = 15* averagetruerange[5](close)
    ATRSL = 4* averagetruerange[3](close)
    ATRS = 4* averagetruerange[2](close)
    ATRSS = 3* averagetruerange[2](close)
    
    if longonmarket then
    set target profit ATRL
    endif
    if longonmarket then
    SET STOP LOSS ATRSL
    endif
    
    if shortonmarket then
    set target profit ATRS
    endif
    if shortonmarket then
    SET STOP LOSS ATRSS
    endif
    
    

     

    
    
    robertogozzi thanked this post
    #111891 quote

    Se invece vuoi proteggere i profitti devi anche mettere un trailing stop.

    #111896 quote
    drfbdrfb
    Participant
    Average

    Intanto grazie del chiarimento. Potresti anche darmi un esempio di trailing stop? Ho visto molti esempi in rete ma ho capito poco il funionafunzio. Grqzie

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

Take profit dinamico


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
drfb @drfb Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by drfbdrfb
6 years, 11 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 11/02/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...