benchmarking PL

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
orion
Posts: 250
Joined: 01 Oct 2014
Has thanked: 65 times
Been thanked: 104 times

benchmarking PL

Postby orion » 01 Nov 2014

I benchmarked MC PL against TS EL. The 50 and 200 bar moving average and 20 bar Bollinger band calculations were timed. Identical code for the indicators was used for the two platforms. The results are in calls/second (cps). Both run on one virtual core of a 6-core dual-thread 3.6GHz processor. Results indicate that MC language compiler is 6-10X faster than TS. Code for your own benchmarking experiments below. Use on a chart with 300+ bars.

Code: Select all

Function TS call rate MC call rate
50-bar sma 600K cps 3400K cps
200-bar sma 150K cps 900K cps
Bollinger band 270K cps 2460K cps

Code: Select all

external: "kernel32.dll", int, "GetTickCount";

vars:
tickCntBegin (0),
tickCntEnd (0),
timeElapsed (0),
niter (1000000),
idx (0),
callRate (0);

if (currentBar = 300) then
once begin

tickCntBegin = GetTickCount;
for idx = 1 to niter begin
// indicator to be benchmarked goes here
value1 = average(close, 200);
end;
tickCntEnd = GetTickCount;

timeElapsed = tickCntEnd - tickCntBegin;
if (timeElapsed > 10) then begin
callRate = niter*1000/timeElapsed;
print ("time elapsed = ", timeElapsed:0:0, " ms", newline,
callRate:0:0, " calls per second");
end else
print ("increase number of iterations since time elapsed is too low");
end;

Return to “User Contributed Studies and Indicator Library”