DYO: Change a Study's Color Based on a Criteria
|
Q: I like to make a study which changes the color of the 34 ema based on price changes. I tried to do it with a DYO but unfortunately I was unable to do it. The ema color is based on the slope of the line. If slope moves less than plus or minus 0.00006 in 4 bars the line is gray. If it moves more than 0.00019 up in 4 bars the line is blue, if down 0.00019 in 4 bars the line is red. In between 0.00006 and 0.00019 the line is respectively light blue or light red (pink will do). Think of it as a 4 bar rate of change measurement of the slow ema line. Any tips how I can do this are very much appreciated
A: This example shows the DYO settings to accomplish your request. Use the tests of the slope to change the color in the default paint can.
Line A is storing the study value in GV[2] and Line G will plot this value.
Line B determines the slope of the study line from Line A, and initializes the form's paint can with a default color of brown.
The criteria tests of the slope are Lines C through F, and when a test it True it changes the color in the paint can.
Line G plots the study line using the selected marker in the color in the paint can because the color selected for the plot is Black.
The Black selection uses the form's paint can whose color was set by Lines B, C, D, E, or F because no Marker was selected on these lines.
Template: 1384-MultiColors
read more » DYO: Select a Marker's Color
Last modified 8/25/09 1:46 PM
|