Using the "CUSTOMMACD" study in ver 11.2 "Built-in Studies Formulas" folder on a 100T chart of "6E #F" with "setIntervalsBackfill(true);" in the preMain() and applying a 2 minute interval to the study, the plot abruptly stops about an hour back.
If I don't use "setIntervalsBackfill(true);" it plots fine.
Please advise if this is an expected result or a bug.
Wayne
If I don't use "setIntervalsBackfill(true);" it plots fine.
Please advise if this is an expected result or a bug.
PHP Code:
/*****************************************************************
Provided By:
Interactive Data Corporation (Copyright © eSignal) 2010.
All rights reserved. This sample eSignal Formula Script (EFS)
is for educational purposes only. Interactive Data Corporation
reserves the right to modify and overwrite this EFS file with
each new release.
******************************************************************/
//for bug issue added "setIntervalsBackfill(true);" in line 15
var fpArray = new Array();
function preMain() {
setStudyTitle("MACD");
setIntervalsBackfill(true);//comment out and it plots fine, otherwise it stops plotting
setCursorLabelName("MACDHist",0);
setCursorLabelName("MACD",1);
setCursorLabelName("MACDSig",2);
setDefaultBarFgColor(Color.RGB(0xFE,0x00,0x6D), 0);
setDefaultBarFgColor(Color.RGB(0x00,0x94,0xFF), 1);
setDefaultBarFgColor(Color.RGB(0xFE,0x69,0x00), 2);
setPlotType(PLOTTYPE_HISTOGRAM,0);
setPlotType(PLOTTYPE_LINE,1);
setPlotType(PLOTTYPE_LINE,2);
setDefaultBarThickness(1,0);
setDefaultBarThickness(1,1);
setDefaultBarThickness(1,2);
askForInput();
var x=0;
fpArray[x] = new FunctionParameter("Fast", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(12);
}
fpArray[x] = new FunctionParameter("Slow", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(26);
}
fpArray[x] = new FunctionParameter("Smoothing", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(9);
}
fpArray[x] = new FunctionParameter("Source", FunctionParameter.STRING);
with(fpArray[x++]){
addOption("open");
addOption("high");
addOption("low");
addOption("close");
addOption("hl2");
addOption("hlc3");
addOption("ohlc4");
setDefault("close");
}
fpArray[x] = new FunctionParameter("Symbol", FunctionParameter.STRING);
with(fpArray[x++]){
setDefault();
}
fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING);
with(fpArray[x++]){
setDefault();
}
fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN);
with(fpArray[x++]){
setName("Show Parameters");
setDefault(false);
}
}
var bInit = false;
var xMACD = null;
var xMACDSig = null;
var xMACDHist = null;
function main(Fast,Slow,Smoothing,Source,Symbol,Interval,Params){
if(bInit == false){
if(Symbol == null) Symbol = getSymbol();
if(Interval == null) Interval = getInterval();
var vSymbol = Symbol+","+Interval;
xMACD = macd(Fast,Slow,Smoothing,eval(Source)(sym(vSymbol)));
xMACDSig = macdSignal(Fast,Slow,Smoothing,eval(Source)(sym(vSymbol)));
xMACDHist = macdHist(Fast,Slow,Smoothing,eval(Source)(sym(vSymbol)));
addBand(0,PS_SOLID,1,Color.grey,"Centerline");
setShowTitleParameters(eval(Params));
bInit = true;
}
return new Array (getSeries(xMACD),getSeries(xMACDSig),getSeries(xMACDHist));
}
Comment