# which way is faster ?

Questions about MultiCharts and user contributed studies.
TJ
Posts: 7097
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 986 times
Been thanked: 2029 times

### which way is faster ?

I have hundreds of these evaluations. Pls tell me which way is faster.
(I have studied this in university years ago, but I do not remember which way)

method 1:

var: condition1(false);
if H > H [1] and L < L[1] then condition1 = true;

method 2:

var: condition1(false);
condition1 = H > H [1] and L < L[1] ;

Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

### Re: which way is faster ?

Hi TJ,

From the point of view of programming the second variant

var: condition1(false);
condition1 = H > H [1] and L < L[1]

is more correct. Also, theoretically it should be faster. In practice, though, the speed of the two methods above would be pretty much the same.

TJ
Posts: 7097
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 986 times
Been thanked: 2029 times
many thanks Marina, especially for your speedy response.

Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007
You are welcome, TJ!

Nick
Posts: 490
Joined: 04 Aug 2006
Has thanked: 4 times
Been thanked: 24 times
If you have hundreds of these types of comparisons its probably worth going boolean the whole way. So for example

higherhigh = h > h[1];
lowerlow = l < [1];
lowerhigh= blah blah
higherclose = blah blah blah

then simply use

if higherhigh + lowerlow + higherclose do something.
if lowerhigh + higherlow + lowerclose do something else

I am not sure if EL supports bitwise logic it may not (setting individual bits inside a word) then that would be even faster.
HH = 0000000000000001
LL = 0000000000000010

then using OR's ANDS and XORS with bitmasks for the condidtions you are testing for. I recall doing some studies like that for price patterns but can't recall if it was easy language or something else.

Cheers,
Nick.

P.S. always intrested in price action/pattern stuff what are you up to?

TJ
Posts: 7097
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 986 times
Been thanked: 2029 times
I am only trying to find a way to filter out inside bars, outside bars, etc. that type of elimination.