Ordini cumulativi pro order

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #209120 quote
    DonatoDonato
    Participant
    New
    Ragazzi salve, vorrei una mano, non riesco ad eseguire lo Stop,  trailing stop e take profit nel trading automatico. Se inserisco tutti e 3,  non posso, nel programma. Ho fatto un programma di trading automatico, tramite il semplificato di pro real t. Come posso usare tutti e 3? Nel programma c’e’ ” defparam cumulateorders=false.” Penso sia quello che mi impedisce di eseguire l’autotrading pro order. Spero in un aiutom il programma e’ abbastanza valido se riesco a farlo girare. Grazie mille
    #209132 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    defparam cumulateorders=false serve ad impedire che più posizioni siano aperte, anche se si verificano nuovamente le condizioni, non fa altro.

    Devi usare SET STOP LOSS e SET TARGET PROFIT (eventualmente con le varianti che hanno p, % oppure $ all’inizio) ed un codice per il trailing stop.

    Esempio:

    If close crosses over average[20,0](close) and not onmarket then
       Buy 1 contract at market
       Set stop ploss 50
       Set target pprofit 100
    Endif
    //************************************************************************
    //trailing stop function
    //
    //https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/
    //
    trailingstart = 20 //trailing will start @trailinstart points profit
    trailingstep = 5 //trailing step to move the "stoploss"
     
    //reset the stoploss value
    IF NOT ONMARKET THEN
     newSL=0
    ENDIF
     
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
     IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THEN
      newSL = tradeprice(1)+trailingstep*pipsize
     ENDIF
    //next moves
     IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
      newSL = newSL+trailingstep*pipsize
     ENDIF
    ENDIF
     
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
     IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
      newSL = tradeprice(1)-trailingstep*pipsize
     ENDIF
    //next moves
     IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
      newSL = newSL-trailingstep*pipsize
     ENDIF
    ENDIF
     
    //stop order to exit the positions
    IF newSL>0 THEN
     SELL AT newSL STOP
     EXITSHORT AT newSL STOP
    ENDIF
    //************************************************************************
    #209138 quote
    DonatoDonato
    Participant
    New
    Roberto sei un grande! Ma io una capra😭 o usato il programma semplificato in proreal time, e ho messo i seguenti valori come stop, trailing stop en take profit, come posso inserirli nel programma che mi hai inviato?  Ti ringrazio tanto per la disponibilità e per le informazioni,  se riesco a farlo girare e va, ti faccio una statua.
    Screenshot_20230205-150008_Gallery.jpg Screenshot_20230205-150008_Gallery.jpg
    #209140 quote
    DonatoDonato
    Participant
    New
    Scusa roberto, ho dimenticato, devo inserire tutti e 3 i parametri anche il trailingstop, con un valore 10. Non so a cosa corrispondano nel programma che mi hai inviato. Vorrei inserirli correttamente
    #209141 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    Devi mettere il tuo codice al posto delle prime 5 righe del mio, poi adattarle. Per il traling stop ci sono due dati:
    • trailingstart è il numero di pip da cui vuoi che inizi
    • trailingstep è il passo di aggiornamento dello stop, cioè ogni quanti pip vuoi che venga aggiornato.
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

Ordini cumulativi pro order


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 02/05/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...