Indicatore da strategia
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Indicatore da strategia
- This topic has 18 replies, 2 voices, and was last updated 6 years ago by
robertogozzi.
-
-
09/28/2018 at 9:15 PM #81577
Ciao, ho una strategia che ho provato a trasformare in indicatore prendendo spunto da un precedente mio post, purtroppo con scarsissimo successo. Potreste aiutarmi?
Lo strumento è il Dax Future 15 minuti, questo è il codice che ho fatto, ma mi da 1 solo risultato che non combacia con quelli della strategia che uso per verificarlo
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162DEFPARAM CALCULATEONLASTBARS = 10000ONCE maxsetup = 0ONCE minSetup = 0//PROFITLONG=110//STOPLONG=85//PROFITSHORT=40//STOPSHORT=80// DOPO 30 PUNTI METTERE LO STOP A PROFIT A 5 PUNTISTARTHOUR = 93000LIMITHOUR = 100000Result = 0if time=91500 thenres=highsupp=lowmaxsetup=0minsetup=0BUYPOSITION=0SELLPOSITION=0endiflongok=(close[1]crosses over res)shortok= (close[1] crosses under supp)if TIME > STARTHOUR AND TIME < LIMITHOUR thenif longok THENif buyposition=0 and maxsetup = 0 thenif iamlong thenbuyposition=1elsemaxsetup = resresult=1DRAWTEXT("#maxsetup#", barindex, high, Dialog, Bold, 10) COLOURED(0,255,0,255)iamlong=1iamshort=0endifENDIFif shortok thenif sellposition=0 and minsetup=0 thenif iamshort thensellposition=1elseminsetup = suppresult=2DRAWTEXT("#minsetup#", barindex, low, Dialog, Bold, 10) COLOURED(255,0,0,255)iamlong=0iamshort=1ENDIFENDIFendifendifIF IamLong AND (TIME> LIMITHOUR) THENResult = 5IamLong = 0ELSIF IamShort AND (TIME > LIMITHOUR) THENResult = 6IamShort = 0endifendifIF Result THEN //blocco IF...ENDIF inutile, solo per usare la variabile RESULTENDIFreturn09/28/2018 at 9:31 PM #81580Che cosa deve indicare?
09/29/2018 at 2:14 PM #8160110/01/2018 at 7:05 PM #8169010/01/2018 at 11:27 PM #81718Immagino di si, su quale TF vuoi usarlo, sul 15 minuti o sul 5 minuti?
10/02/2018 at 5:11 PM #81789il segnale proviene dal 15 minuti, poi lo gestisco con il 5, ho fatto questa strategia ORB per il multiframe che ho lanciato sui CFD, ora io vorrei usarla anche sui futures ufficiali, ma li io non esiste il PRO-ORDER, quindi l’unica possibilità per poterla usare è farne un indicatore, siccome deve dirmi anche i prezzi di entrata e di stop l’unica cosa è qualcosa ad histogramma.
Potete aiutarmi?
ti incollo la strategia completa:
Open Range Breakout12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576DEFPARAM FLATBEFORE = 080000DEFPARAM PRELOADBARS = 10000DEFPARAM FLATAFTER = 210000DEFPARAM CUMULATEORDERS = FALSEONCE maxsetup = 0ONCE minSetup = 0PROFITLONG=110STOPLONG=85PROFITSHORT=40STOPSHORT=80//once breakeaven = 0//startBreakeven = 30//PointsToKeep = 5//////////////////////////////////////////////////TIMEFRAME (15 MINUTES, UPDATEONCLOSE)ONCE RES = 0ONCE SUPP = 0if time=91500 thenres=highsupp=lowgraphonprice resgraphonprice suppendifignored, ignored, ignored, ignored, ignored, COMPOM = CALL "Composite momentum"[4, 3, 9]//graph compomavt=AverageTrueRange[14](close)TIMEFRAME (DEFAULT)//avt=AverageTrueRange[14](close)longok=(close[1]crosses over res) and (avt>9.25) and (compom<51)shortok= (close[1] crosses under supp) and (avt>19.5)and (compom<56)if OnMarket THENMinSetup=0MaxSetup=0ENDIFIF NOT ONMARKET THENmaxsetup=0minsetup=0ENDIF///////ORDINI////////////////////BUY ORDERSif not onmarket and TIME > 93000 AND TIME < 100000 and longok THENIF maxsetup = 0 THENmaxsetup = resendifBUY 1 CONTRACT AT maxsetup limitendif//SELL ORDERSif not onmarket and TIME > 93000 AND TIME < 100000 and shortok THENif minsetup = 0 thenminsetup = suppendifSELLSHORT 1 CONTRACT AT minsetup limitENDIFIF LONGONMARKET THENSET TARGET PPROFIT PROFITLONGSET STOP PLOSS STOPLONGELSEIF SHORTONMARKET THENSET TARGET PPROFIT PROFITSHORTSET STOP PLOSS STOPSHORTENDIFENDIFif time>212300 thenexitshort at marketsell at marketendifTIMEFRAME (DEFAULT)10/02/2018 at 6:06 PM #81801Provalo, io non l’ho testato perché non ho quell’indicatore
123456789101112131415161718192021222324252627DEFPARAM CALCULATEONLASTBARS = 500//PROFITLONG = 110STOPLONG = 85//PROFITSHORT = 40STOPSHORT = 80ONCE RES = 0ONCE SUPP = 0if time = 091500 thenres = highsupp = lowendifignored, ignored, ignored, ignored, ignored, COMPOM = CALL "Composite momentum"[4, 3, 9]avt = AverageTrueRange[14](close)longok = (close[1] crosses over res) and (avt > 9.25) and (compom < 51)shortok = (close[1] crosses under supp) and (avt > 19.5) and (compom < 56)IF longok THENPrezzo = resSl = res - (STOPLONG * pipsize)ELSIF shortok THENPrezzo = suppSl = supp + (STOPSHORT * pipsize)ENDIFIF longok OR shortok THENDRAWTEXT("#Prezzo#", barindex, Prezzo, Dialog, Bold, 10) COLOURED(0,255,0,255)DRAWTEXT("#Sl#" , barindex, Sl, Dialog, Bold, 10) COLOURED(0,255,0,255)ENDIFRETURN10/02/2018 at 6:44 PM #81803Provalo, io non l’ho testato perché non ho quell’indicatore
123456789101112131415161718192021222324252627DEFPARAM CALCULATEONLASTBARS = 500//PROFITLONG = 110STOPLONG = 85//PROFITSHORT = 40STOPSHORT = 80ONCE RES = 0ONCE SUPP = 0if time = 091500 thenres = highsupp = lowendifignored, ignored, ignored, ignored, ignored, COMPOM = CALL “Composite momentum”[4, 3, 9]avt = AverageTrueRange[14](close)longok = (close[1] crosses over res) and (avt > 9.25) and (compom < 51)shortok = (close[1] crosses under supp) and (avt > 19.5) and (compom < 56)IF longok THENPrezzo = resSl = res – (STOPLONG * pipsize)ELSIF shortok THENPrezzo = suppSl = supp + (STOPSHORT * pipsize)ENDIFIF longok OR shortok THENDRAWTEXT(“#Prezzo#”, barindex, Prezzo, Dialog, Bold, 10) COLOURED(0,255,0,255)DRAWTEXT(“#Sl#” , barindex, Sl, Dialog, Bold, 10) COLOURED(0,255,0,255)ENDIFRETURNma è nel Database del sito PRC!
10/02/2018 at 6:54 PM #81804Non usare spesso il QUOTE, altrimenti i post si allungano smisuratamente, tanto si sa di cosa si parla.
Usalo solo quando davvero vuoi evidenziare qualcosa di specifico, magari togliendo dalla citazione le righe superflue. Grazie.
10/02/2018 at 9:02 PM #8180710/03/2018 at 7:24 PM #8186610/03/2018 at 7:41 PM #8186810/03/2018 at 8:58 PM #81870Ho aggiustato l’indicatore con le frecce visto che non sono capace a fare quello ad istogramma, mi da pero’ un errore, non mi disegna bene i segmenti per gli stop, infatti ho inserito che mi segnali un segmento all’altezza dei take profit per i long e viene regolarmente disegnato, ma non segnala il segmento per lo stop (devo aver sbagliato qualcosa) nè mi disegna il segmento per le operazioni short
Altro quesito, mi disegna troppe frecce (MOTIVO per cui volevo optare per far uscire un histogramma con i valori) dovrebbe disegnarmela solo una volta e non sempre, questo avviene perchè me le segnala finchè non vengono meno le condizioni ? (come altre variabili atr etc?)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253DEFPARAM CALCULATEONLASTBARS = 500PROFITLONG = 110STOPLONG = 85PROFITSHORT = 40STOPSHORT = 80ONCE RES = 0ONCE SUPP = 0if time = 091500 thenres = highsupp = lowendifignored, ignored, ignored, ignored, ignored, COMPOM = CALL "Composite momentum"[4, 3, 9]avt = AverageTrueRange[14](close)longok = (close[1] crosses over res) and (avt > 9.25) and (compom < 51)shortok = (close[1] crosses under supp) and (avt > 19.5) and (compom < 56)IF longok THENPrezzo = resSl = res - (STOPLONG * pipsize)GAIN=PREZZO+PROFITLONGELSIF shortok THENPrezzo = suppSl = supp + (STOPSHORT * pipsize)GAIN=PREZZO+PROFITSHORTENDIFIF longok THENDRAWARROWUP(barindex,LOW-15)coloured(127,255,212)DRAWTEXT("#PREZZO#", barindex, HIGH+10, Dialog, Bold,10) COLOURED(127,255,212)//PREZZO DI ENTRATA//////////////////////////////////////////////////////////PREZZO E GRAFICA STOP LOSSDRAWTEXT("#Sl#" , barindex, LOW-10*PIPSIZE, Dialog, Bold, 10) COLOURED(255,191,0)DRAWSEGMENT(barindex,LOW-SL,barindex-SL, HIGH+SL)coloured(255,191,0)////////////////////////////////////////////////PREZZO E GRAFICA TAKE PROFIT//////////////DRAWSEGMENT(barindex,HIGH+PROFITLONG,barindex+20, HIGH+PROFITLONG)coloured(127,255,212)DRAWTEXT("#GAIN#" , barindex-2, HIGH+PROFITLONG, Dialog, Bold, 10) COLOURED(127,255,212)// LIVELLO DI PROFITELSEIF SHORTOK THENDRAWARROWDOWN(barindex,HIGH+15)coloured(255,0,0)DRAWTEXT("#Prezzo#", barindex, LOW-10, Dialog, Bold, 10) COLOURED(255,0,0)//////////////////////////////////////////////////////////PREZZO E GRAFICA STOP LOSSDRAWTEXT("#Sl#" , barindex, HIGH+10,Dialog, Bold, 10) COLOURED(255,191,0)DRAWSEGMENT(barindex,HIGH+SL,barindex+SL, HIGH+SL)coloured(255,191,0)//PREZZO E GRAFICA TAKE PROFITDRAWSEGMENT(barindex,LOW-SL,barindex-SL, LOW-SL)coloured(255,0,0)DRAWTEXT("#GAIN#" , barindex-2, LOW-PROFITSHORT,Dialog, Bold, 10) COLOURED(255,0,0)ENDIFENDIFRETURN10/04/2018 at 10:37 AM #81891Ho provato a scaricare un Composite Momentum dalla libreria, ma è leggermente diverso, restituisce 6 parametri, ma non ne richiede nessuno tra parentesi quando lo chiami, hai aggiunto te quei 3 parametri [4,3,9], cosa sono?
1CALL "Composite momentum"[4, 3, 9]10/04/2018 at 10:51 AM #81893 -
AuthorPosts
Find exclusive trading pro-tools on