Gestione ordini in uscita

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #54187 quote
    SAMSAM
    Participant
    Senior

    Buona Sera, 
    chiedo cortesemente una mano per migliorare questo semplice trading-system..

    defparam CUMULATEORDERS = false
    once stopp=0
    once size =2
    once tprofit1=0
    once tprofit2=0
    a1= supertrend[3,10]
    
    c1 = close crosses over a1
    
    
    if c1 then
    buy size shares at market
    stopp=a1
    tprofit= close + (close -stopp)*0.5
    tprofit2= close + (close-stopp)
    endif
    
    sell size shares at stopp stop
    sell size shares at tprofit limit
    

    Vorrei , che una volta comprati 2  o più contratti, ne venda la metà al raggiungimento del 1° take profit e la seconda metà al raggiungimento del 2° take profit.

    Qualcuno può gentilmente aiutarmi?
    Eventualmente potete indicarmi dei post dove avete già trattato l’argomento per la gestione delle posizioni?

    Grazie mille

    #54188 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Non è consentita la chiusura parziale di posizioni aperte.

    Roberto

    #54189 quote
    SAMSAM
    Participant
    Senior

    Davvero? come mai? se posso chiederlo?

     

    #54191 quote
    SAMSAM
    Participant
    Senior

    Scusa Roberto, ma non capisco con questo modifica riesco a chiudere parzialmente le posizioni… 
    Ho allegato anche una immagine che come vedi chiude prima un contratto e dopo un altro…

    defparam CUMULATEORDERS = false
    
    once stopp=0
    once size =2
    once tprofit=0
    a1= supertrend[3,10]
    
    c1 = close crosses over a1
    
    
    if c1 then
    buy size shares at market
    stopp=a1
    tprofit= close + (close -stopp)*0.5
    endif
    
    if longonmarket then
    sell size shares at stopp stop
    sell size/2 shares at tprofit limit
    endif

     

    Immagine1.jpg Immagine1.jpg
    #54194 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Certo, se apri una posizione e la chiudi prima di aprirne un’altra puoi aprirne e chiuderne quante vuoi, ma se compri 2 contratti non puoi chiuderne uno e lasciare aperta metà posizione.

    Il perché PRT non lo conxsente va chiesto a loro, non saprei dirlo. Magari in una futura versione può darsi che sia reso possibile.

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

Gestione ordini in uscita


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
SAM @amos Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
8 years, 10 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 11/27/2017
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...