How can I plot multiple MACD's on the same screen so that they chart on the same plot?
Announcement
Collapse
No announcement yet.
How can I plot multiple MACD's on the same screen?
Collapse
X
-
One would use an EFS file returning multiple MACDs.
Here is such a file:
PHP Code:function preMain()
{
setPriceStudy(false);
setStudyTitle("MultiMACD");
setCursorLabelName("macd(12, 26, 9)", 0);
setCursorLabelName("macd(7, 13, 5)", 1);
setCursorLabelName("macd(50, 20, 6)", 2);
setComputeOnClose(true);
setDefaultBarFgColor(Color.fushcia, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarFgColor(Color.green, 2);
setDefaultBarThickness(2, 0);
setDefaultBarThickness(2, 1);
setDefaultBarThickness(2, 2);
addBand(0, PS_SOLID, 1, Color.white, "ZeroLine");
addBand(2.5, PS_SOLID, 1, Color.white, "AnotherLine");
addBand(-2.5, PS_SOLID, 1, Color.white, "AnotherLine2");
setStudyMin(-5);
setStudyMax(5);
}
var macd1 = null;
var macd2 = null;
var macd3 = null;
function main()
{
if (macd1 == null) {
macd1 = macd(12, 26, 9);
macd2 = macd(7, 13, 5);
macd3 = macd(50, 20, 6);
}
return new Array( macd1.getValue(0), macd2.getValue(0), macd3.getValue(0) );
}
Comment