Anomalies Indicateur Kagi et ProBacktests
Forums › ProRealTime English forum › ProOrder support › Anomalies Indicateur Kagi et ProBacktests
- This topic has 2 replies, 2 voices, and was last updated 3 years ago by
Bernard13.
-
-
12/04/2021 at 6:05 PM #182819
Bonjour Nicolas et la Communauté
En voulant tester en Backtest le programme “PRC Kagi on price chart” de Nicolas, je m’aperçois d’anomalies en UT inférieures à Daily et Weekly.
Les comparaisons élémentaires kagi[1] < kagi et kagi[1] > kagi ne suffisent-elles plus ?
Merci d’avance de vos réponses.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364ONCE Capital= 10000Nbre= ROUND(Capital/Close)//PRC_Kagi on price chart | indicator//05.09.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge// --- settings// select one of the two possible setting (0=don't use)ReversalAmountPercent = 1.5 //amount of price percent to inverse Kagi trend//ReversalAmountPoints = 0 //amount of points to inverse Kagi trend// --- end of settingsonce kagi=close//if ReversalAmountPercent>0 then//percent retracementpup = (close-kagi)/kagipdn = (kagi-close)/kagiInvDec = 1/0.1//bullish reversalif pup>=ReversalAmountPercent/100 thencoeff = abs(pup/ReversalAmountPercent)*100coeff = round(InvDec*coeff-0.5)/InvDeckagi=kagi+(kagi*(ReversalAmountPercent/100)*coeff)//r=0//g=255endif//bearish reversalif pdn>=ReversalAmountPercent/100 thencoeff = abs(pdn/ReversalAmountPercent)*100coeff = round(InvDec*coeff-0.5)/InvDeckagi=kagi-(kagi*(ReversalAmountPercent/100)*coeff)//r=255//g=0endif//endif//RETURN Kagi coloured(r,g,0) style(line,3)//----------Process// Conditions pour ouvrir une position acheteuseIF NOT LongOnMarket AND kagi[1] < kagi THENBUY Nbre SHARES AT MARKETENDIF// Conditions pour fermer une position acheteuseIF LongOnMarket AND kagi[1] > kagi THENSELL AT MARKETENDIF// Conditions pour ouvrir une position en vente à découvert//IF NOT ShortOnMarket AND VosConditions THEN//SELLSHORT 1 CONTRACTS AT MARKET//ENDIF// Conditions pour fermer une position en vente à découvert//IF ShortOnMarket AND VosConditions THEN//EXITSHORT AT MARKET//ENDIF// Stops et objectifs : entrez vos stops et vos objectifs ici12/06/2021 at 10:14 AM #182866Le Kagi doit être calculé différemment, voir sa valeur avec un
1GRAPH kagiEnsuite, puisque sa variation dépend d’un pourcentage, la valeur affichée peut différer de celle calculé par la stratégie (différence d’historique). En effet, si on démarre plus tôt, le prix a varier plus.
Si tu supprimes le pré chargement d’historique avec:
1defparam preloadbars=0cela pourrait sans doute aider.
12/06/2021 at 11:06 AM #182875 -
AuthorPosts