I am having difficulty aligning back testing results that use STOP and LIMIT orders for entering and exiting trades with the real time results.
The discrepancy goes way beyond slippage and I have documented several times.
It was suggested earlier that there were advantages to using getSeries() to getValue().
I am trying to program a simple moving average that is utilized by several AGET strategies called a 6/4 Displaced moving average. It is a 6 period moving average displaced 4 bars ahead using both getSeries() and getValue() and expected to see the same values for both and am not.
Is anyone familiar with these two functions that can shed a little light?
Using getValue() my understanding was to use vMA6High.getValue(-4) and thought the equivalent was getSeries(vMA6High, 4)?
var vMA6High = null;
var bInit = false;
function premain(){
setComputeOnClose();
}
function main() {
if ( bInit == false ) {
vMA6High = sma(6, high()) ;
bInit = true;
}
return new Array( getSeries( vMA6High,4), vMA6High.getValue(-4) );
}
Thank you.
Glen
The discrepancy goes way beyond slippage and I have documented several times.
It was suggested earlier that there were advantages to using getSeries() to getValue().
I am trying to program a simple moving average that is utilized by several AGET strategies called a 6/4 Displaced moving average. It is a 6 period moving average displaced 4 bars ahead using both getSeries() and getValue() and expected to see the same values for both and am not.
Is anyone familiar with these two functions that can shed a little light?
Using getValue() my understanding was to use vMA6High.getValue(-4) and thought the equivalent was getSeries(vMA6High, 4)?
var vMA6High = null;
var bInit = false;
function premain(){
setComputeOnClose();
}
function main() {
if ( bInit == false ) {
vMA6High = sma(6, high()) ;
bInit = true;
}
return new Array( getSeries( vMA6High,4), vMA6High.getValue(-4) );
}
Thank you.
Glen
Comment