Rank: Advanced Member
Groups: Registered, Registered Users Joined: 4/27/2005(UTC) Posts: 126 Location: Italy
|
The following system based of FT Fixed and Dynamic Balance Point plots ok as both an indicator and an expert but gives nul results in system tester (latch omitted below).
Mc1:=BarsSince(DayOfWeek()=1); Fc1:=BarsSince(DayOfWeek()=5); Fc2:=Ref(BarsSince(DayOfWeek()=5),-1)-1; {Fixed Balance Point Calculation} FBC:=If(Mc1=0 AND Fc1>2, {then}(Ref(HHV(H,LastValue(mc1)),-1)+ Ref(LLV(L,LastValue(Mc1)),-1)+ Ref(C,-1))/3, {else}If(Fc1=0 AND Mc1>5, {then}(HHV(H,LastValue(Fc2))+ LLV(L,LastValue(Fc2))+C)/3, {else}If(Fc1=0, {then}(HHV(H,LastValue(Mc1))+ LLV(L,LastValue(Mc1))+C)/3, {else}0))); {Fixed Balance Point Plot} FBP:=ValueWhen(1,FBC>0,FBC); FPS:= (ValueWhen(1,FBC>0,FBC) + ValueWhen(2,FBC>0,FBC) + ValueWhen(3,FBC>0,FBC) + ValueWhen(4,FBC>0,FBC) + ValueWhen(5,FBC>0,FBC))/5;
LE:= Fps>Ref(Fps,-5) AND C>FBP; SE:= Fps<Ref(Fps,-5) AND C<FBP; LX:= C<FBP; SX:= C>FBP;
The message received in System Tester is "Invalid time period (zero or negative) passed to HHV() function". Any ideas how this could be rectified and the reason for the discrepancy observed?
Thanks and regards.
Maurizio
|