Suppression des lignes horizontales
Forums › ProRealTime forum Français › Support ProBuilder › Suppression des lignes horizontales
- This topic has 8 replies, 4 voices, and was last updated 5 years ago by Nicolas.
-
-
10/27/2019 at 3:28 PM #111342
Bonjour, dans l’indicateur suivant (que j’ai programmé) apparait une ligne horizontale lorsque la condition définie est remplie. Pour une question de lisibilité, j’aimerai que cette ligne disparaît. Comment faire SVP?
merci d’avance.
Une zone colorée apparaît lorsque les moyennes mobiles ne s'écartent pas des dernières 50 dernières moyennes mobiles123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869// KAMA50Period = 50FastPeriod = 2SlowPeriod = 30Fastest = 2 / (FastPeriod + 1)Slowest = 2 / (SlowPeriod + 1)if barindex < Period+1 thenKama=closeelseNum = abs(close-close[Period])Den = summation[Period](abs(close-close[1]))ER = Num / DenAlpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1])endifavg = kama// KAMA50Period1 = 200FastPeriod1 = 2SlowPeriod1 = 30Fastest1 = 2 / (FastPeriod1 + 1)Slowest1 = 2 / (SlowPeriod1 + 1)if barindex < Period1+1 thenKama200=closeelseNum1 = abs(close-close[Period1])Den1 = summation[Period1](abs(close-close[1]))ER1 = Num1 / Den1Alpha1 = SQUARE(ER1 *(Fastest1 - Slowest1 )+ Slowest1)KAMA200 = (Alpha1 * Close) + ((1 -Alpha1)* Kama200[1])endifavg1 = kama200if avg > avg1 thendistanceup = abs(avg- avg1)endifif avg < avg1 thendistancedown = abs(avg - avg1)endifa = average[50](distanceup)b = average[50](distancedown)bornehaute = avg1 +Abornebasse = avg1 - Bactionzone = (kama < bornehaute) and (kama > bornebasse) and (kama200 < bornehaute) and (kama200 > bornebasse)bornehauteintervention = bornehaute and actionzonebornebasseintervention = bornebasse and actionzonereturn bornehauteintervention as "borne haute KAMA", bornebasseintervention as "borne basse KAMA"10/28/2019 at 9:38 AM #11138610/28/2019 at 7:24 PM #11145110/29/2019 at 9:25 AM #111497Ces lignes verticales sont issues des variables “bornehauteintervention” et “bornebasseintervention”, car tu as codé des conditions booléennes (1= vrai ; 0 = faux). Mais ce que je ne comprends pas c’est pourquoi celle-ci retourne des valeurs différentes, c’est à dire celles de ‘borne haute’ et ‘borne basse’ qui sont justement contenues dans ces booléens…
En fait, si je résume, tu as “mal” codé tes variables, mais en le faisant, tu as découvert un comportement ‘buggé’ de la restitution de leurs valeurs (mais qui apparemment te conviens ?) Je vais reporter ce phénomène, que je trouve vraiment étrange 🙄
Pour répondre à la question sur l’invisibilité des lignes verticales, je vois 2 solutions possibles, soit jouer avec l’alpha (transparence) de la couleur des lignes, soit restituer les lignes avec des composants graphiques de type DRAWSEGMENT.
10/29/2019 at 9:59 AM #111503Essaye ça:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768// KAMA50Period = 50FastPeriod = 2SlowPeriod = 30Fastest = 2 / (FastPeriod + 1)Slowest = 2 / (SlowPeriod + 1)if barindex < Period+1 thenKama=closeelseNum = abs(close-close[Period])Den = summation[Period](abs(close-close[1]))ER = Num / DenAlpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1])endifavg = kama// KAMA50Period1 = 200FastPeriod1 = 2SlowPeriod1 = 30Fastest1 = 2 / (FastPeriod1 + 1)Slowest1 = 2 / (SlowPeriod1 + 1)if barindex < Period1+1 thenKama200=closeelseNum1 = abs(close-close[Period1])Den1 = summation[Period1](abs(close-close[1]))ER1 = Num1 / Den1Alpha1 = SQUARE(ER1 *(Fastest1 - Slowest1 )+ Slowest1)KAMA200 = (Alpha1 * Close) + ((1 -Alpha1)* Kama200[1])endifavg1 = kama200if avg > avg1 thendistanceup = abs(avg- avg1)endifif avg < avg1 thendistancedown = abs(avg - avg1)endifa = average[50](distanceup)b = average[50](distancedown)bornehaute = avg1 +Abornebasse = avg1 - Bactionzone = (kama < bornehaute) and (kama > bornebasse) and (kama200 < bornehaute) and (kama200 > bornebasse)if actionzone thendrawsegment(barindex[1],bornehaute[1],barindex,bornehaute)drawsegment(barindex[1],bornebasse[1],barindex,bornebasse)endifreturn10/29/2019 at 10:44 AM #111511Or this one:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970// KAMA50Period = 50FastPeriod = 2SlowPeriod = 30Fastest = 2 / (FastPeriod + 1)Slowest = 2 / (SlowPeriod + 1)if barindex < Period+1 thenKama=closeelseNum = abs(close-close[Period])Den = summation[Period](abs(close-close[1]))ER = Num / DenAlpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1])endifavg = kama// KAMA50Period1 = 200FastPeriod1 = 2SlowPeriod1 = 30Fastest1 = 2 / (FastPeriod1 + 1)Slowest1 = 2 / (SlowPeriod1 + 1)if barindex < Period1+1 thenKama200=closeelseNum1 = abs(close-close[Period1])Den1 = summation[Period1](abs(close-close[1]))ER1 = Num1 / Den1Alpha1 = SQUARE(ER1 *(Fastest1 - Slowest1 )+ Slowest1)KAMA200 = (Alpha1 * Close) + ((1 -Alpha1)* Kama200[1])endifavg1 = kama200if avg > avg1 thendistanceup = abs(avg- avg1)endifif avg < avg1 thendistancedown = abs(avg - avg1)endifa = average[50](distanceup)b = average[50](distancedown)bornehaute = avg1 +Abornebasse = avg1 - Bactionzone = (kama < bornehaute) and (kama > bornebasse) and (kama200 < bornehaute) and (kama200 > bornebasse)IF actionzone = 0 thenbornehaute = bornehaute[1]bornebasse = bornebasse[1]ENDIF//bornehauteintervention = bornehaute and actionzone//bornebasseintervention = bornebasse and actionzonereturn bornehaute AS "High",bornebasse AS "Low"//bornehauteintervention as "borne haute KAMA", bornebasseintervention as "borne basse KAMA"10/29/2019 at 7:23 PM #11157010/30/2019 at 1:05 AM #111605Or this one:
Only French in the French speaking forum please Roberto! 🙂
1 user thanked author for this post.
10/30/2019 at 9:55 AM #111619Pour information, le soucis de variable qui retourne sa vrai valeur dans une condition booléenne est connu et présent depuis toujours dans les versions inférieures à la v11 ! Bref, c’est chose du passé désormais grâce l’update version 11 de la plateforme.
1 user thanked author for this post.
-
AuthorPosts