Gestione ordini in uscita

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #54187 quote
    SAM
    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
    robertogozzi
    Moderator
    Master

    Non è consentita la chiusura parziale di posizioni aperte.

    Roberto

    #54189 quote
    SAM
    Participant
    Senior

    Davvero? come mai? se posso chiederlo?

     

    #54191 quote
    SAM
    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

     

    #54194 quote
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
8 years, 2 months ago.

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