The “STYLE” keyword defines the styles of any returned values of an indicator. It is intended to styling programmatically instead of do it manually in the indicator window.
This keyword is located right after the optional keyword “COLOURED” and before the “AS” one.
Syntax:
1 |
RETURN myvariable STYLE(<custom style>,<width>) |
Styling options available :
- LINE : draw plain continuous line (default style)
- DOTTEDLINE : draw a dotted line
- DOTTEDLINE1: draw a dotted line with a different style (see below)
- DOTTEDLINE2: draw a dotted line with a different style (see below)
- DOTTEDLINE3: draw a dotted line with a different style (see below)
- DOTTEDLINE4: draw a dotted line with a different style (see below)
- HISTOGRAM : draw an histogram
- POINT : draw a point series
Example of styling in RETURN :
1 2 3 4 5 6 7 |
i1 = linearregression[20](close) i2 = linearregression[10](close) diff = i2-i1 avgdiff = exponentialaverage[7](diff) RETURN diff coloured(50,146,175,90) STYLE(histogram,2) as "LR difference", avgdiff coloured(227,247,40) STYLE(line,3) as "Avg of difference", avgdiff[1] coloured(227,247,40) STYLE(dottedline,1) as "delayed Avg of difference" |
Example: DOTTEDLINE styling
1 2 3 4 5 6 7 8 |
defparam drawonlastbaronly=true drawhline(medianprice) style(dottedline1) drawhline(medianprice-10*pointsize) style(dottedline1) drawhline(medianprice-20*pointsize) style(dottedline2) drawhline(medianprice-30*pointsize) style(dottedline3) drawhline(medianprice-40*pointsize) style(dottedline4) return |
I believe they should add invisible as a style also. Some of my indicators can be used in the price chart or underneath. Depending on where I use it, I change some of the returned variables as invisible – would be great to set some of them invisible by default.
It is possible to add transparency on coloured instruction now as well in the new 10.3 version of prorealtime. I updated the COLOURED instruction page here : http://www.prorealcode.com/documentation/coloured/
Bonjour,
Je suppose que Line, Dotted…. sont des expressions obligatoires… Dommage qu’on ne puisse pas les remplacer par un numéro prédéfini ou que Prorealtime n’accepte pas les expressions alphanumériques …
On pourrait écrire : Vline style(1,2) ou le premier chiffre 1 désigne Line , 2 pour DottedLine etc
ou si Prorealtime autorisait
mavar = dottedline
vline(mavar,2)
on pourrait ainsi modifier le style à la volée par programmation
C’est une bonne idée, merci de l’avoir proposé.
Un style “dashedline” serait apprécié (ligne pointillée)
bonjour,
il serait aussi interessant que la puissance de style puisse être une donnée alphanumérique pour faire varier graphiquement la puissance de line ou de dottedline en fonction de situations conditionnelles.
Est ce possible sur V11 ?