Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Where to start? First, the code is actually below, posted using *code* and */code* tags: Code:
(if((C-L)/(H-L),>,.66 ,1, if((C-L)/(H-L),<,.38,-1,0))) +
(if(oscv(1,50,S,%),>,50,1,0)) +
(if((mov(H-L,1,S)/mov(H-L,20,S)),>=,1.00,1,0))+
(if(ref(stoch(14,3),-1),<,65,1, if(stoch(14,3),<,65,1,0)))
Next, the code is from a very old version of MS (DOS version if I remember correctly). The code is poorly written for the 'modern' versions of MS. Even then, the code is poorly written from the perspective of not using variables when the same operations are repeated, using if(x,1,0) statements when MS does this operation anyway, and no DBZ error checking. Personally, I'd be doing something more like: Code:
zero:=Power(10,-5);
range:=H-L;
x:=(C-L)/Max(range,zero);
{plot}
((x>0.66) - (x<0.38)) +
(OscV(1,50,S,%)>50) +
(range/Max(Mov(range,20,S),zero)>=1) +
Alert(Stoch(14,3)<65,2);
Next, the MS error window which appears may have the title of 'math errors', but here on the forum that information is of little use. You should have posted that the math errors the code produces are DBZ errors (or whatever other specifics are being reported). The more information you provide us, the less work we have to do in trying to figure out what is wrong. wabbit [:D]
|