Buongiorno, vorrei un aiuto per convertire questo in prt. grazie
La prossima volta usa il paeg dedicato per chiedere la conversione e seguire le regole: https://www.prorealcode.com/free-code-conversion/
E non duplicare i post, per favore, né usando la stessa lingua, né usando lingue diverse. Grazie.
Scusate ero di fretta ho letto male
Buongiorno, ho provato a tradurlo ma non sapendo l’idea che c’è dietro è difficile, sono sicuro che è stato pensato per Non essere sempre a mercato , quello scritto da me rimane sempre a mercato
Questo è il modo in cui l’ho tradotto. Non so se l’accumulo dell’ordine è permesso o no? La strategia è scambiata solo con il tempo giornaliero o con altri tempi ma con valori giornalieri?
Se hai ulteriori informazioni, mi aiuterebbe a capire chiaramente che è davvero usato!
defparam cumulateorders=false
nBar=5
mystop=2000
myprofit=1000
Mul=0.95
DonchianExitLenght=1
NumBarreExit=0
////definizione del donchian per l'ingresso e per l'uscita
triglong = low < lowest[nBar](low)[1]
trigshort = high > highest[nBar](high)[1]
exitlong = high > highest[DonchianExitLenght](high)[1]
exitshort1 = low < lowest[DonchianExitLenght](low)[1]
/////definizione filtro di vola - espansione
Vola=average[2](Range) > Mul *average[22](Range)
If vola then
if triglong then
buy at low limit
endif
If trigshort then
sellshort at high limit
endif
endif
//////////// EXIT sui massimo/minimi
if exitlong then
Sell at high limit
endif
if exitshort1 then
exitshort at low limit
endif
if barindex-tradeindex>NumBarreExit then
if longonmarket then
sell at market
endif
if shortonmarket then
exitshort at market
endif
endif
set stop ploss mystop
set target pprofit myprofit
Ciao Nicolas, viene usata sul 15 min , però è una strategia tranquilla
Non credo sia con accumulo ordini
grazie la provo subito
ok, ma se lo usi in un intervallo di tempo di 15 minuti, utilizzerà i valori di 15 minuti, non quelli del timeframe giornaliero .. Ecco perché l’ho chiesto! Quindi dovrebbe avere bisogno di ulteriore codifica per renderlo possibile più tempistiche.
Se serve io ho i file di multicharts.
DEFPARAM CUMULATEORDERS = false
nbar=5
triglong=low< DLow(nbar)
trigshort=high>DHigh(nbar)
exitlong=high> highest [nbar] (DHigh(1))
uscitashort= low< lowest [nbar] (dhigh(1))
vola=average(range[2])>mul*average(range[22])
prezzolong= dlow (1)
prezzoshort= dhigh (1)
mul= 0.95
//entrate
if vola and triglong then
buy 1 contract at prezzolong limit
endif
if vola and trigshort then
sellshort 1 contract at prezzoshort limit
endif
//uscite
if exitlong then
sell 1 contract at prezzoshort limit
endif
if uscitashort then
exitshort 1 contract at prezzolong limit
endif
SET TARGET PROFIT 1000
SET STOP LOSS 2000
Nicolas credo che data2 1440 siamo 1440 minuti, quindi 1 day. Ho aggiunto la mia traduzione per farti fare una risata . buona giornata
Ciao Nicolas, ho chiesto come funziona la strategia, compra quando ci sono nuovi minimi (15min) del donchian 5 giorni. controtrend.Non sono una volpe a scrivere codici ma non capisco come l’autore possa usarla in reale come dice o se sbaglio qualcosa
defparam cumulateorders=false
nBar=10
mystop=2000
myprofit=1000
Mul=0.95
Donchianexitleght=1
NumBarreExit=0
timeframe (1day,updateonclose)
longtrig=lowest [nbar] (low)
shorttrig=highest [nbar](high)
massimiexit= highest [donchianexitleght](high)
minimiexit= lowest [donchianexitleght](low)
Vola=average[2](Range) > Mul *average[22](Range)
timeframe (default)
////definizione del donchian per l'ingresso e per l'uscita
triglong = low < longtrig
trigshort = high > shorttrig // massimo maggiore del massimo dei massimi di 5 giorni
exitlong = high > massimiexit
exitshort1 = low < minimiexit
/////definizione filtro di vola - espansione
If vola then
if triglong then
buy at low limit
endif
If trigshort then
sellshort at high limit
endif
endif
//////////// EXIT sui massimo/minimi
if exitlong then
Sell at high limit
endif
if exitshort1 then
exitshort at low limit
endif
if barindex-tradeindex<NumBarreExit then
if longonmarket then
sell at market
endif
if shortonmarket then
exitshort at market
endif
endif
set stop ploss mystop
set target pprofit myprofit
GRAPHONPRICE minimiexit
GRAPHONPRICE massimiexit COLOURED(0,0,200)
GRAPHONPRICE longtrig COLOURED(0,200,0)
GRAPHONPRICE shorttrig COLOURED(200,0,0)
Ciao, non ne azzecca una neanche per sbaglio 🙂 , tempo fa ne ho fatto uno che era l’opposto