setBar() |
Top Previous Next |
setBar( type, barIndex, seriesIndex, value ) setBar( type, barIndex, value | arrayOfValues )
This function allows you to adjust the value and/or the properties of a prior bar of a study being displayed. For example, if you are calculating and displaying 2 moving average studies in your script, you could use the setBar() function to change the actual value, color, line style or thickness of a previously-displayed value from either one of the studies or even both of the studies.
Parameters
Valid Types
Usage
//set the value of the prior bar of the first study you are returning //from your script to 22. setBar( Bar.Value, -1, 22 );
//set the value of the prior bar of the 3rd study you are returning //from your script to 25. setBar( Bar.Value, -1, 3, 25 );
//set the line style of the first study returned from your script to PS_SOLID (3 bars ago) setBar( Bar.Style, -3, 2, PS_SOLID );
//Assume your script is returning 3 values to be plotted. The following code will change //the backround color of each study (at a point 10 bars ago) to blue, green and yellow respectively. setBar( Bar.BgColor, -10, new Array( Color.blue, Color.green, Color.yellow ) );
|