Hi,
I'm trying to create a series by substracting the current value of two other series.
I know the script below plots fine but I need to access the last value of that created series using Series.getValue(0) for use in a larger efs study.
As I understand it, the output of efsInternal should create a series as in:
But I have only been able to create a single value. It plots fine but I need it as a series. I've tried many variations, even including the DIFF = Test(); within a bInit routine but that doesn't work either.
I appreciate any help.
wayne
I'm trying to create a series by substracting the current value of two other series.
I know the script below plots fine but I need to access the last value of that created series using Series.getValue(0) for use in a larger efs study.
As I understand it, the output of efsInternal should create a series as in:
PHP Code:
debugClear();
function preMain() {
setPriceStudy(false);
}
function main() {
DIFF = test();
return DIFF;
}
/ *************************************************
SUPPORT FUNCTIONS
**************************************************/
var xPDI = null;
var xNDI = null;
function test(){
xPDI = pdi(10,12);
xNDI = ndi(10,12);
return xPDI.getValue(0)-xNDI.getValue(0);
}
I appreciate any help.
wayne
Comment