Poids des criteres dans resultat screener
Forums › ProRealTime forum Français › Support ProScreener › Poids des criteres dans resultat screener
- This topic has 3 replies, 3 voices, and was last updated 3 years ago by
trading2.
-
-
12/30/2021 at 7:08 PM #184169
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 //+++++++++++
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970TIMEFRAME(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 *CloseTIMEFRAME (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 + 1ENDIF//+++++++++++++++++++++++++++++++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 + 1ENDIF//+++++++++++++++++++++++++++++++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 + 1ENDIF//+++++++++++++++++++++++++++++++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 + 2ENDIF//+++++++++++++++++++++++++++++++Indic5 = CALL "RSI9 > BBH20"f1 = (Indic5 = 1)f2 = (Indic5[1] = 1)OK5 = (a1 AND f1 ) OR (a1 AND f2)//+++++++++++++++++++++++++++++++IF OK5 THEN Force = Force + 2ENDIF//+++++++++++++++++++++++++++++++//+++++++++++++++++++++++++++++++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")01/12/2022 at 7:47 PM #185299Bonsoir, 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:
123IF OK1 THENForce = Force + 1ENDIF01/15/2022 at 4:10 PM #18557502/02/2022 at 4:16 PM #187368 -
AuthorPosts
Find exclusive trading pro-tools on 