Poids des criteres dans resultat screener
- This topic has 3 replies, 3 voices, and was last updated 3 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
Similar topics:
Forums › ProRealTime forum Français › Support ProScreener › Poids des criteres dans resultat screener
Bonjour,
Débutant en programmation j’ai un souci que je n’arrive pas à résoudre dans le code du screener ci attaché.
Je souhaite ajouter comme critere de tri dans le resultat du screener le poids total des criteres pour chaque titre . j’ai dans ce screener 5 criteres avec un poids = à 1 ou 2 que j’ai qualifie pour chaque critère.
Si par exemple un titre possede le critere OK 1 alors sa Force sera = à 1
si un titre possède les critères OK1 et OK4 alors sa Force sera = 1+2 = 3
si un tire possède les criteres OK 4 et OK 5 alors sa Force sera = à 2 +2 = 4
J’ai deja une erreur avec les IF ….. ENDIF ( surement toute bete ???? ) et je ne sais pas si je dois initialiser au départ la variable Force à 0 ?
j’ai mis les lignes de codequi posent problème entre //+++++++++++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
TIMEFRAME(daily) userindic1 = CALL "Range Volatilty" indicator1 = ExponentialAverage[6](userindic1) a1 = (indicator1 >= SeuilVolat/100) AND (Volume > SeuilVolume) AND (Close > SeuilValeur) // A FAIRE ---> Modifier Seuil Vol et Seuil Valeur par Volume *Close TIMEFRAME (default) //+++++++++++++++++++++++++++++++ Force = 0 //+++++++++++++++++++++++++++++++ Indic1 = CALL "LS and Clo xH +Haut15P (LS>Clo" b1 = (Indic1 = 1) b2 = (Indic1[1] = 1) OK1 = (a1 AND b1 ) OR (a1 AND b2) //+++++++++++++++++++++++++++++++ IF OK1 THEN Force = Force + 1 ENDIF //+++++++++++++++++++++++++++++++ Indic2 = CALL "Clo xH BBH100" c1 = (Indic2 = 1) c2 = (Indic2[1] = 1) OK2 = (a1 AND c1 ) OR (a1 AND c2) //+++++++++++++++++++++++++++++++ IF OK2 THEN Force = Force + 1 ENDIF //+++++++++++++++++++++++++++++++ Indic3 = CALL "LS and Close xH BBH200"(close) d1 = (Indic3 = 1) d2 = (Indic3[1] = 1) OK3 = (a1 AND d1 ) OR (a1 AND d2) //+++++++++++++++++++++++++++++++ IF OK3 THEN Force = Force + 1 ENDIF //+++++++++++++++++++++++++++++++ Indic4 = CALL "Squeeze Carter 100 BB14P" e1 = (Indic4 = 0) e2 = (Indic4[1] = 1) OK4 = (a1 AND e1 AND e2) // Squeeze Carter passe à 0 //+++++++++++++++++++++++++++++++ IF OK4 THEN Force = Force + 2 ENDIF //+++++++++++++++++++++++++++++++ Indic5 = CALL "RSI9 > BBH20" f1 = (Indic5 = 1) f2 = (Indic5[1] = 1) OK5 = (a1 AND f1 ) OR (a1 AND f2) //+++++++++++++++++++++++++++++++ IF OK5 THEN Force = Force + 2 ENDIF //+++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++ criteria = Force //+++++++++++++++++++++++++++++++ SCREENER[OK1 OR OK2 OR OK3 OR OK4 OR OK5] (criteria AS "Force") //criteria = CALL "Range Volatilty" //SCREENER[OK1 OR OK2 OR OK3 OR OK4 OR OK5] (criteria AS "Range Volatilty") |
Bonsoir, code remis au format PRT dans le post ci-dessus. Quand le bouton “insert PRT code” n’apparait pas, merci de faire CTRL+F5 cf https://www.prorealcode.com/topic/insert-prt-code-button-ctrlf5-to-bring-it-back-if-missing/
Tous ces if OK1, if OK2 etc… ont renvoyé une erreur car il manque le retour à la ligne après le “then”. Exemple de syntaxe correcte:
1 2 3 |
IF OK1 THEN Force = Force + 1 ENDIF |
Find exclusive trading pro-tools on