PureBytes Links
Trading Reference Links
|
You can say what you want about Pierre but the guy does know a lot about
EL. Alain Jossart questions the value of optimizing code for speed:
> A=c-c[3];B=.03*(A-A[1])+.97*B;
>
> Nice EL code, but are you convinced ? - Where is the demonstration
> that, once compiled, it is certainly faster than a compiled :
>
> VALUE1 = @MOMENTUM(C,3);
> VALUE2 = @MOMENTUM(C,3)[1];
> VALUE3 = .03*(VALUE1-VALUE2)+(1-.03)*VALUE3;
>
> The truth is not there ! The kind of optimization games doesn't make
> any sense for a modern programmer... they should even less for
> a trader.
So I ran a little test, as much to convince myself as anything.....
----------------------
for value1 = 1 to 1000 begin
value2 = c-c[3];
value3 = .03*(value2-value2[1])+.97*value3;
value1 = value1+1;
end;
plot1(value3,"");
This one took 20 seconds to plot.
-------------------------
for value0 = 1 to 1000 begin
VALUE1 = @MOMENTUM(C,3);
VALUE2 = @MOMENTUM(C,3)[1];
VALUE3 = .03*(VALUE1-VALUE2)+(1-.03)*VALUE3;
value0 = value0+1;
end;
plot1(value3,"");
This one took 85 seconds to plot.
---------------------------
Pierre wins by more than 4 to 1. When we start running complicated
indicators and systems on lots of data, it is clearly worth the effort
to optimize the code for speed.
There, Pierre... I said something nice about you. :-)
--
Dennis
|