I'm really new to working with EFS and having problems doing what I'd like to do and wonder if anyone can help me tweak my first code.
On the image, I'm using DrawShapeRelative on the Stochastic when it either goes above 75 or below 25 it produces either a red or green line at the bottom. I'm actually wanting the green to be on top of the Stochastic and can't seem to get it there. Also I have colored my bars to replicate this but I'm wanting to also have them go red when my fast Stochastic has crossed over the slow, again I'm lost. Each time I add the line in my code to do this it completely changes my colored bars from what are now.
any guidance would be appreciated.
tks
On the image, I'm using DrawShapeRelative on the Stochastic when it either goes above 75 or below 25 it produces either a red or green line at the bottom. I'm actually wanting the green to be on top of the Stochastic and can't seem to get it there. Also I have colored my bars to replicate this but I'm wanting to also have them go red when my fast Stochastic has crossed over the slow, again I'm lost. Each time I add the line in my code to do this it completely changes my colored bars from what are now.
any guidance would be appreciated.
tks
PHP Code:
var vStoch14_3 = new StochStudy(14, 3, 3);
function preMain() {
setPriceStudy(false);
setStudyTitle("Stochastic Price Bars 4");
setStudyMin(0);
setStudyMax(100);
setCursorLabelName("StoK", 0);
setCursorLabelName("StoD", 1);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarThickness(1, 0);
setDefaultBarThickness(1, 1);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
addBand(75, PS_SOLID, 1, Color.navy, "a");
addBand(25, PS_SOLID, 1, Color.navy, "b");
}
function main() {
if (vStoch14_3.getValue(StochStudy.FAST) > 75 &&
vStoch14_3.getValue(StochStudy.SLOW) > 75) {
setPriceBarColor(Color.lime);
setBarThickness(2);
setBarFgColor(Color.blue);
drawShapeRelative(0, low(), Shape.SQUARE, "", Color.RGB(0,128,18), Shape.ONTOP);
}
else if (vStoch14_3.getValue(StochStudy.FAST) < 25 &&
vStoch14_3.getValue(StochStudy.SLOW) < 25) {
setPriceBarColor(Color.red);
setBarThickness(2);
setBarFgColor(Color.red);
drawShapeRelative(0, low(), Shape.SQUARE, "", Color.RGB(255,0,0), Shape.ONTOP);
}
return new Array(
vStoch14_3.getValue(StochStudy.FAST),
vStoch14_3.getValue(StochStudy.SLOW)
);
}
Comment