I am setting the periodicity to weekly. I checked a couple of times to make sure.
Then I Place the box to buy
LE:=C>Mov(C,30,S) AND
Mov(C,30,S)-Ref(Mov(C,30,S),-1) >0;
LX:=C <mov(C,30,S)
AND (Mov(C,30,S)-Ref(Mov(C,30,S),-1))<0;
B:=ExtFml("forum20.latch",LE,LX,0,0);
B=1 AND Ref(b,-1) 1;
I place in the box to sell the other set of the equations
SE:=C <mov(C,30,S) AND
Mov(C,30,S)-Ref(Mov(C,30,S),-1) <0;
SX:=C >Mov(C,30,S)
AND (Mov(C,30,S)-Ref(Mov(C,30,S),-1))>0;
B:=ExtFml("forum20.latch",SE,SX,0,0);
B=1 AND Ref(b,-1) 1;
The I place in the Sell Short the same
SE:=C <mov(C,30,S) AND
Mov(C,30,S)-Ref(Mov(C,30,S),-1) <0;
SX:=C >Mov(C,30,S)
AND (Mov(C,30,S)-Ref(Mov(C,30,S),-1))>0;
B:=ExtFml("forum20.latch",SE,SX,0,0);
B=1 AND Ref(b,-1) 1;
and then I place in the buy to cover the first set of the equations.
LE:=C>Mov(C,30,S) AND
Mov(C,30,S)-Ref(Mov(C,30,S),-1) >0;
LX:=C <mov(C,30,S)
AND (Mov(C,30,S)-Ref(Mov(C,30,S),-1))<0;
B:=ExtFml("forum20.latch",LE,LX,0,0);
B=1 AND Ref(b,-1) 1;
After that I run the system starting from JAN 2000 until today on the ES500 or Emini, using points without any stops or any other settings for both (long and shorts) and I get a negative number.
Then I look at the chart with the expert advisor on the weekly chart and I calculate the results by hand. The results are obviiously different.
I am sure I am making a fundamental mistake somewhere, but I am unable to locate so far.
Thanks in advance
Anaxos