Un truc m"échappe sur mon screener de croisement de MM
Forums › ProRealTime forum Français › Support ProScreener › Un truc m"échappe sur mon screener de croisement de MM
- This topic has 6 replies, 3 voices, and was last updated 7 years ago by Nicolas.
-
-
07/01/2017 at 3:36 PM #39547
J’essaie de faire un pauvre screener basique 😉
L’idée c’est juste d’avoir 2 moyennes mobiles différentes en weekly. Quand la plus rapide croise la plus longue, on a notre condition.
Je colle mon code :
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586TIMEFRAME(weekly)//----------------------------//// JMA - Jurik Moving Average ////----------------------------//// --- parametersJMASeries = CloseJMAPeriod = 7 // (7 (short), 35 (medium), 175 (long))JMAPow = 2 // ({ 1..10 })JMAPhase = 0 // ({-100..100})// ---beta = 0.45 * (JMAPeriod - 1) / (0.45 * (JMAPeriod - 1) + 2)IF JMAPhase < -100 THENR = 0.5ELSIF JMAPhase > 100 THENR = 2.5ELSER = 0.01 * JMAPhase + 1.5ENDIFIF JMAPow = 1 THENalpha = betaELSIF JMAPow = 2 THENalpha = beta * betaELSIF JMAPow = 3 THENalpha = beta * beta * betaELSIF JMAPow = 4 THENalpha = beta * beta * beta * betaELSIF JMAPow= 5 THENalpha = beta * beta * beta * beta * betaELSIF JMAPow = 6 THENalpha = beta * beta * beta * beta * beta * betaELSIF JMAPow = 7 THENalpha = beta * beta * beta * beta * beta * beta * betaELSIF JMAPow = 8 THENalpha = beta * beta * beta * beta * beta * beta * beta * betaELSIF JMAPow = 9 THENalpha = beta * beta * beta * beta * beta * beta * beta * beta * betaELSIF JMAPow = 10 THENalpha = beta * beta * beta * beta * beta * beta * beta * beta * betaENDIFIF BarIndex = 0 THENFilt0 = JMASeriesFilt1 = JMASeriesJMA = JMASeriesELSEFilt0 = (1 - alpha) * JMASeries + alpha * Filt0[1]Det0 = (JMASeries - Filt0[0]) * (1 - beta) + beta * Det0[1]Filt1 = Filt0[0] + R * Det0[0]Det1 = (Filt1[0] - JMA[1]) * ((1 - alpha) * (1 - alpha)) + (alpha * alpha) * Det1[1]JMA = JMA[1] + Det1[0]ENDIF//------------------------------------------------------------//// BSF2P - 2-Pole Butterworth Smoothing Filter by John Ehlers ////------------------------------------------------------------//// --- parametersBSF2PSeries = CloseBSF2PPeriod = 16// ---a1 = EXP(-1.414 * 3.14159 / BSF2PPeriod)b1 = 2 * a1 * COS(1.414 * 180 / BSF2PPeriod)coef2 = b1coef3 = -a1 * a1coef1 = (1 - b1 + a1 * a1) / 4IF BarIndex < 2 THENBSF2P = BSF2PSeriesELSEBSF2P = coef1 * (BSF2PSeries + 2 * BSF2PSeries[1] + BSF2PSeries[2]) + coef2 * BSF2PSeries[1] + coef3 * BSF2PSeries[2]ENDIF//-----------//// Condition ////-----------//Condition = JMA crosses over BSF2PSCREENER[Condition]Bon ben quand je lance le screener, j’ai pas mal de résultat, mais c’est tout sauf que je veux 😉
Aucun croisement, rien.
Un truc doit m’échapper mais je vois pas!
07/01/2017 at 6:33 PM #3956007/01/2017 at 8:17 PM #3956407/02/2017 at 9:57 AM #39571I’ve not interpreted / understood your code, but is below okay? Barindex = 0 … means there are no bars??
IF BarIndex = 0 THENFilt0 = JMASeriesFilt1 = JMASeriesJMA = JMASeriesELSE1 user thanked author for this post.
07/02/2017 at 12:38 PM #39583It’s okay, the index of BarIndex starts to 0. That’s the first bar to the left of the chart.
In fact I have just copied/pasted the code of my indicators in the screener and I have not the same results (wrong ones) than when they are attached on a chart in weekly.
It only works when I use CALL.
It’s very strange.
07/04/2017 at 9:38 AM #3976007/04/2017 at 9:50 AM #39761Merci GraHal pour le rappel à l’ordre ! 😀
En effet lorsque tu CALL l’indicateur, celui-ci ne doit pas être interprété par le moteur de ProScreener mais par celui de ProBuilder et les résultats peuvent différer. Même si ça ne semble pas être le cas ici, il ne faut pas oublier que ProScreener a une limite de 254 bars d’historique, peu importe le timeframe utilisé.
-
AuthorPosts
Find exclusive trading pro-tools on