Hello... im trying to do a simple color change on an indicator, but i was unable to do it. Seams i can't retrive data from my .getValue (-).
can anyone help me please. What i would like to do is Plot Red if indicator falling, and plot green is rising.
---- EFS ---
function preMain() {
setPriceStudy(true);
setStudyTitle("MP");
setCursorLabelName("50%", 0);
setDefaultBarStyle(PS_DOT, 0);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarThickness(2, 0);
setPlotType(PLOTTYPE_LINE, 0);
//}}EFSWizard_PreMain 29264
}
function main(vBars, vOffset) {
//Create Edit Functions to Change LookBack and Offset
if (vBars == null) {
vBars = 20;
}
if (vOffset == null) {
vOffset = 2;
}
//Create New Indicator to Get Highest High and Lowest Low
var vDonchian = new DonchianStudy(vBars+2, vOffset);
var vDochUp = (vDonchian.getValue(DonchianStudy.UPPER));
var vDochDown = (vDonchian.getValue(DonchianStudy.LOWER));
//Calc MidPoint of the Range
var vDochMidpoint = (vDochUp + vDochDown)
//Change Color
// if( vDochMidpoint > vDochMidpoint.getSeries(-1)) {
// setPriceBarColor(Color.green);}
debugPrintln(vDochMidpoint/2)
return (vDochMidpoint/2);
can anyone help me please. What i would like to do is Plot Red if indicator falling, and plot green is rising.
---- EFS ---
function preMain() {
setPriceStudy(true);
setStudyTitle("MP");
setCursorLabelName("50%", 0);
setDefaultBarStyle(PS_DOT, 0);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarThickness(2, 0);
setPlotType(PLOTTYPE_LINE, 0);
//}}EFSWizard_PreMain 29264
}
function main(vBars, vOffset) {
//Create Edit Functions to Change LookBack and Offset
if (vBars == null) {
vBars = 20;
}
if (vOffset == null) {
vOffset = 2;
}
//Create New Indicator to Get Highest High and Lowest Low
var vDonchian = new DonchianStudy(vBars+2, vOffset);
var vDochUp = (vDonchian.getValue(DonchianStudy.UPPER));
var vDochDown = (vDonchian.getValue(DonchianStudy.LOWER));
//Calc MidPoint of the Range
var vDochMidpoint = (vDochUp + vDochDown)
//Change Color
// if( vDochMidpoint > vDochMidpoint.getSeries(-1)) {
// setPriceBarColor(Color.green);}
debugPrintln(vDochMidpoint/2)
return (vDochMidpoint/2);
Comment