Problema con backtest su indicatore
Forums › ProRealTime forum Italiano › Supporto ProOrder › Problema con backtest su indicatore
- This topic has 2 replies, 2 voices, and was last updated 7 years ago by tatankayotanka.
-
-
01/15/2017 at 11:53 PM #21215
Buonasera, ho provato ha fare back test dell indicatore da me modificato “Velocity mix ” ma non me lo esegue ,io penso che sia dovuto al fatto che nell’ indicatore ci sono più curve che per° alla fine creano lo stesso nome , per cui il back test non produce risultati , di seguito pubblico lo script dell indicatore sia lo script del backtest
“Indicatore ”
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172//Tracy//short=8//vfactor=.7Data=customclosex1=(exponentialaverage[short](Data))*(1+vfactor)x2=(exponentialaverage[short](exponentialaverage[short](Data)))*vfactorgd=x1-x2x11=(exponentialaverage[short](gd))*(1+vfactor)x21=(exponentialaverage[short](exponentialaverage[short](gd)))*vfactorgd1=x11-x21x12=(exponentialaverage[short](gd1))*(1+vfactor)x22=(exponentialaverage[short](exponentialaverage[short](gd1)))*vfactorfirst=x12-x22y1=(exponentialaverage[short](Data))*(1+vfactor/2)y2=(exponentialaverage[short](exponentialaverage[short](Data)))*vfactor/2ygd=y1-y2y11=(exponentialaverage[short](ygd))*(1+vfactor/2)y21=(exponentialaverage[short](exponentialaverage[short](ygd)))*vfactor/2ygd1=y11-y21y12=(exponentialaverage[short](ygd1))*(1+vfactor/2)y22=(exponentialaverage[short](exponentialaverage[short](ygd1)))*vfactor/2second=y12-y22S = first - second[1]//T+2//intermediate =32//vfactor=0.7x10=(exponentialaverage[intermediate ](Data))*(1+vfactor)x20=(exponentialaverage[intermediate ](exponentialaverage[intermediate ](Data)))*vfactorgd2=x10-x20x110=(exponentialaverage[intermediate ](gd2))*(1+vfactor)x210=(exponentialaverage[intermediate ](exponentialaverage[intermediate ](gd2)))*vfactorgd20=x110-x210x120=(exponentialaverage[intermediate ](gd20))*(1+vfactor)x220=(exponentialaverage[intermediate ](exponentialaverage[intermediate ](gd20)))*vfactorfirst1=x120-x220y10=(exponentialaverage[intermediate ](Data))*(1+vfactor/2)y20=(exponentialaverage[intermediate ](exponentialaverage[intermediate ](Data)))*vfactor/2ygd2=y10-y20y110=(exponentialaverage[intermediate ](ygd2))*(1+vfactor/2)y210=(exponentialaverage[intermediate ](exponentialaverage[intermediate ](ygd2)))*vfactor/2ygd20=y110-y210y120=(exponentialaverage[intermediate ](ygd20))*(1+vfactor/2)y220=(exponentialaverage[intermediate ](exponentialaverage[intermediate ](ygd20)))*vfactor/2second1=y120-y220S1 = first1 - second1[1]//T+3//long=64//vfactor=.7x100=(exponentialaverage[long](Data))*(1+vfactor)x200=(exponentialaverage[long](exponentialaverage[long](Data)))*vfactorgd3=x100-x200x1100=(exponentialaverage[long](gd3))*(1+vfactor)x2100=(exponentialaverage[long](exponentialaverage[long](gd3)))*vfactorgd30=x1100-x2100x1200=(exponentialaverage[long](gd30))*(1+vfactor)x2200=(exponentialaverage[long](exponentialaverage[long](gd30)))*vfactorfirst2=x1200-x2200y100=(exponentialaverage[long](Data))*(1+vfactor/2)y200=(exponentialaverage[long](exponentialaverage[long](Data)))*vfactor/2ygd3=y100-y200y1100=(exponentialaverage[long](ygd3))*(1+vfactor/2)y2100=(exponentialaverage[long](exponentialaverage[long](ygd3)))*vfactor/2ygd30=y1100-y2100y1200=(exponentialaverage[long](ygd30))*(1+vfactor/2)y2200=(exponentialaverage[long](exponentialaverage[long](ygd30)))*vfactor/2second2=y1200-y2200S2 = first2 - second2[1]return S coloured (255,0,0) as "SHORT" , S1 coloured (0,160,0) as "INTERMEDIATE", S2 coloured (0,0,255) as "LONG",0 coloured (1,1,1)//as "level 0"backtest
12345678910111213141516171819202122// Definizione dei parametri del codiceDEFPARAM CumulateOrders = False // Posizioni cumulate disattivate// Condizioni per entrare su posizioni longindicator1, ignored, ignored, ignored = CALL "Velocity mix Mari"[8, 32, 64, 0.7](close)c1 = (indicator1 CROSSES OVER indicator1)ignored, indicator2, ignored, ignored = CALL "Velocity mix Mari"[8, 32, 64, 0.7](close)c2 = (indicator2 > indicator2)ignored, ignored, indicator3, ignored = CALL "Velocity mix Mari"[8, 32, 64, 0.7](close)c3 = (indicator3 > indicator3)IF c1 AND c2 AND c3 THENBUY 1 CASH AT MARKETENDIF// Condizioni per uscire da posizioni longindicator4, ignored, ignored, ignored = CALL "Velocity mix Mari"[8, 32, 64, 0.7](close)c4 = (indicator4 CROSSES UNDER indicator4)IF c4 THENSELL AT MARKETENDIF// Stop e targetSET STOP pLOSS 2SET TARGET pPROFIT 1001/18/2017 at 8:27 PM #21629È don ‘necessario dichiarare l’indicatore 4 volte. È possibile utilizzare solo istruzioni 1 chiamare per 4 diverse variabili nella stessa linea:
1234567891011121314151617181920// Definizione dei parametri del codiceDEFPARAM CumulateOrders = False // Posizioni cumulate disattivate// Condizioni per entrare su posizioni longindicator1,indicator2,indicator3,indicator4 = CALL "Velocity mix Mari"[8, 32, 64, 0.7](close)c1 = (indicator1 CROSSES OVER indicator1)c2 = (indicator2 > indicator2)c3 = (indicator3 > indicator3)IF c1 AND c2 AND c3 THENBUY 1 CASH AT MARKETENDIF// Condizioni per uscire da posizioni longc4 = (indicator4 CROSSES UNDER indicator4)IF c4 THENSELL AT MARKETENDIF// Stop e targetSET STOP pLOSS 2SET TARGET pPROFIT 10Il problema nel codice è certamente in condizione di C1 e C4 quando si verifica se una variabile sta attraversando il proprio valore .. che è impossibile 🙂
Anche voi volete sapere se un valore è superiore al proprio valore in condizioni di C2 e C3 …01/20/2017 at 8:11 PM #21915Ok grazie, buon weekend
-
AuthorPosts
Find exclusive trading pro-tools on