2 STOPLOSS
Forums › ProRealTime forum Italiano › Supporto ProOrder › 2 STOPLOSS
- This topic has 2 replies, 2 voices, and was last updated 4 years ago by mat024.
-
-
05/18/2020 at 7:21 PM #132203
Ciao, stavo valutando di mettere due strategie in un solo codice, una strategia di tipo trend following e una mean reversing, è possibile mettere 2 stop loss e due target profit? uno per strategia e se possibile come devo fare? oppure devo far funzionare due strategie separate?
Potrei sapere anche se è possibile modificare lo stop loss in trailing stop oppure modificarne il valore se la posizione va in profitto in modo da proteggere i profitti?
Grazie Mille
Matteo
MR & TF123456789101112131415161718192021222324252627282930313233343536373839404142DEFPARAM CUMULATEORDERS = FALSE// MEAN REVERSINGc01 = close < average [200]c1 = close crosses under average [41]c2 = close crosses over average[49]//ATRREV = AVERAGETRUERANGE[M]>AVERAGETRUERANGE[N][O]//TREND FOLLOWINGc0 = close > average [200]c3 = close crosses over average [20]c4 = close crosses under average[50]//ATRFOL = AVERAGETRUERANGE[20]>AVERAGETRUERANGE[2][8]//c4 = averagetruerange[1]>averagetruerange[1][5]//____________________MEAN REVERSING______________________________if c1 and c01 and not onmarket thenbuy 1000 CASH at marketendifif c2 thensell at marketendifset stop %loss (200)set target %profit (100)//___________________TREND FOLLOWING_____________________________if c3 and c0 and not onmarket thenbuy 1000 cash at marketendifif c4 thensell at marketendifset stop $loss (100)set target %profit (100)05/19/2020 at 7:31 AM #132237In questo caso, inserisci le istruzioni stoploss e takeprofit subito dopo aver inviato un ordine per ciascuna strategia specifica:
12345678910111213141516171819202122//____________________MEAN REVERSING______________________________if c1 and c01 and not onmarket thenbuy 1000 CASH at marketset stop %loss (200)set target %profit (100)endifif c2 thensell at marketendif//___________________TREND FOLLOWING_____________________________if c3 and c0 and not onmarket thenbuy 1000 cash at marketset stop $loss (100)set target %profit (100)endifif c4 thensell at marketendifIn questo caso, lo stoploss è impostato una volta per tutti e per ciascuna strategia.
05/23/2020 at 7:36 PM #132984 -
AuthorPosts
Find exclusive trading pro-tools on