Colorer un indicateur
Forums › ProRealTime forum Français › Support ProBuilder › Colorer un indicateur
- This topic has 6 replies, 2 voices, and was last updated 8 years ago by supertiti.
-
-
10/14/2016 at 2:06 PM #14902
Bonjour à tous,
J’aimerai colorer un indicateur en fonction de sa position par rapport à un autre paramètre de ce même indicateur.
Comme exemple j’ai pris le TDI où j’aimerai faire ressortir de couleurs différentes le TDI (mab) selon qu’il se trouve au dessus ou en dessous de “mid ”
A vos crayons si vous avez une idée …
12345678910111213141516171819202122232425262728293031// TDI Trader dynamic index by Nicolasr = rsi[lengthrsi](close)ma = average[lengthband](r)offs = 1.6185 * std[lengthband](r)up = ma+offsdn = ma-offsoffs1 = 1.786 * std[lengthband](r)up1 = ma+offs1dn1 = ma-offs1mid = (up+dn)/2mab = average[lengthrsipl](r)mbb = average[lengthtradesl](r)lineup = 68linemid = 50linedown = 32RETURN mab as "TDI" , mbb as " ma TDI " , lineup as "line up", linemid as "line mid", linedown as "line down", up coloured(0,238,238) as "up", dn coloured(0,238,238) as "dn", mid coloured(0,238,238) as "mid" , up1 coloured(0,238,238) as "up1", dn1 coloured(0,238,238) as "dn1"// Variables :// lengthRSI = 13 decimal// lengthband = 34 decimal// lengthrsipl = 2 entier// lengthtradesl = 7 entier10/17/2016 at 2:04 PM #1503010/17/2016 at 3:52 PM #15037Je m’y suis mis ce matin et j’ai fais ça , ce qui me semble satisfaisant :
12345678910111213141516171819202122232425262728293031323334// TDI Trader dynamic index V1 by Nicolas modifié DID 17.10.2016r = rsi[lengthrsi](close)ma = average[lengthband](r)offs = 1.6185 * std[lengthband](r)up = ma+offsdn = ma-offsoffs1 = 1.786 * std[lengthband](r)up1 = ma+offs1dn1 = ma-offs1mid = (up+dn)/2mab = average[lengthrsipl](r)mbb = average[lengthtradesl](r)lineup = 68linemid = 50linedown = 32// coloration indicateurif mab > mid thensignal = mabelsesignal = - mabendifRETURN mab coloured by signal as "TDI" , mbb as " ma TDI " , lineup as "line up", linemid as "line mid", linedown as "line down", up coloured(0,238,238) as "up", dn coloured(0,238,238) as "dn", mid coloured(0,238,238) as "mid" , up1 coloured(0,238,238) as "up1", dn1 coloured(0,238,238) as "dn1"// Variables :// lengthRSI = 13 decimal// lengthband = 34 decimal// lengthrsipl = 2 entier// lengthtradesl = 7 entier10/17/2016 at 3:58 PM #15042Ici tu ne colories que mab avec sa propre valeur en fait ..
Il faut bien comprendre l’instruction “coloured by” qui ne peut avoir que 2 conditions : soit 1 ou -1 (ou alors au dessus ou en dessous de 0). Si c’est supérieur à 0, alors la couleur de cette variable sera fonction de la couleur que tu choisiras pour “Hausse” dans la fenêtre de paramétrage et inversement quand c’est inférieur à 0.
10/17/2016 at 4:33 PM #1504610/17/2016 at 8:10 PM #1506410/18/2016 at 8:57 AM #15087 -
AuthorPosts
Find exclusive trading pro-tools on