[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

script speed and backtest



PureBytes Links

Trading Reference Links

Tz,

I have tested today a combination of gann hilo with the
Nonlinear Ehlers Filters
something like this code below, but I have had 5 differents gann hilo 
( 3 for the stock and 2 for a foreign() function).
the test was so slow!!
I am supposing that a plugin dll will be better and faster.
just tell me: I think javascript and c++ are a little similar.

stephane


pds=Optimize("pds",10,5,10,1);
mp = (High + Low)/2;
/* Distant Coefficient is calculated here using AFL scripting */ 
EnableScript("vbscript");
coef = mp;
<%
mp = AFL( "mp" )
coef = AFL( "coef" )
pds = AFL( "pds" )
For i = pds To UBound( mp )
coef( i ) = 0
For k = 1 To pds 
coef( i ) = coef( i ) + ( mp( i ) - mp( i - k ) )^2
Next
Next
AFL("coef") = coef
%>
Ehlers=Sum( coef * mp, pds )/Sum( coef, pds );
/*Gann HiLoShort*/
Ehs= Sum( coef * H, pds )/Sum( coef, pds );
Els= Sum( coef * L, pds )/Sum( coef, pds );
Hl=IIf(Close>Ref(Ehs,-1), 1,
IIf(Close<Ref(Els,-1), -1, 0));
Hv=ValueWhen(HL != 0,HL,1);
HiloSh=IIf(Hv==-1,ehs,els);