thanks TJ,
the original code has more than 1000 lines... is only a little part so I didn´t declare vars.
Anyway It would be like this:
Code: Select all
Inputs:
MI_Parameter(1)
;
Vars:
modeLong(false),
modeShort(false)
;
If (Close of data11 > 0) then begin
If (Close of data10 / Close of data11) cross above (0.25*MI_Parameter) then begin
ModeShort = false;
ModeLong = true;
end;
end;
Also gives error.
The code than you proposed don´t compile and correcting the mistakes it worked well.
Code: Select all
var:
c10( c, data10 ),
c11( c, data11 ),
c1011( 0 ),
MI_Par25( 0 ),
modeSHORT(false),
modeLong (false),
MI_Parameter(1)
;
if c11 > 0 then c1011 = c10 / c11
else c1011 = 0;
MI_Par25 = 0.25*MI_Parameter;
If C11 > 0 and ( C1011 cross above MI_Par25 ) then
begin
modeSHORT = false;
modeLong = true;
end;
I never had needed to declare each variable to calculate it, in EasyLanguage works well but not in PowerLanguage.
Thanks for the lesson, it appears very important.