I am having some difficulties in converting an expression into a serial object. The expression is
so far I got
I have to admit that I'm stuck in converting
( hhv(fpLength, high()) + llv(fpLength, low()) + close() ) / 3.0;
to work with series.
Thanks
PHP Code:
nPRHigh = hhv(fpLength, high());
nPRLow = llv(fpLength, low());
nPRPrice = ( hhv(fpLength, high()) + llv(fpLength, low()) + close() ) / 3.0;
return new Array(nPRPrice, nPRHigh, nPRLow );
PHP Code:
// global variables
var bInit = false; //initialization flag
var nPRPrice = null; //Pivot Range Price
var nPRHigh = null; //Pivot Range High
var nPRLow = null; //Pivot Range low
function main(fpSymbol, fpInterval, fpPT1, fpPS1, fpThick1, fpColor1, fpPT2, fpPS2, fpThick2, fpColor2, fpPT3, fpPS3, fpThick3, fpColor3, fpPVar, fpLength)
{
// one time initialization
if(bInit == false){
if(fpSymbol == null) fpSymbol = getSymbol();
if(fpInterval == null) fpInterval = getInterval();
var vSymbol = fpSymbol + "," + fpInterval;
nPRHigh = hhv(fpLength, high(sym(vSymbol)) );
nPRLow = llv(fpLength, low(sym(vSymbol)) );
nPRPrice =
bInit = true;
} //end of initialization
//nPRPrice = ( hhv(fpLength, high()) + llv(fpLength, low()) + close() ) / 3.0;
return new Array(nPRPrice, nPRHigh, nPRLow );
( hhv(fpLength, high()) + llv(fpLength, low()) + close() ) / 3.0;
to work with series.
Thanks
Comment