[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with code!



PureBytes Links

Trading Reference Links

Hi Jeff,

Please try

e3=IIF(b1==1 and d3==1,10,-10);

instead of:

> e3=IIF(b1=d3=1,10,-10);

the '==' checks equivalence, while the '=' is for assignment. ie in 
your equation you are assigning to b1 and d3 the value of 1.

I'm not sure if you need the 'and' I havent tested it, but I would 
use it just to be sure.

Cliff Elion

--- In amibroker@xxxx, "Jeff Gholson" <jgholson@xxxx> wrote:
> Ok...I've looked at this thing until I'm cross-eyed. It seems like 
it
> should function properly but it doesn't for me...sometimes it helps 
to have
> others to look at it so here it goes...
> 
> b1=IIF(close>ref(close, -1),1,-1);
> f1=IIF(close>ma(close,10),2,-2);
> d2=IIF(close>ma(close,20),3,-3);
> e2=IIF(ma(close,10)>ma(close,20),1,-1);
> d3=IIF(volume>ma(volume,20),1,-1);
> 
> e3=IIF(b1=d3=1,10,-10);
> 
> graph0=e3;
> 
> 
> The problem is the e3! It will not change! It remains at +10. I 
have
> manually ran this against price data that should turn it to -10,but 
it won't
> change in the program. When the e3 IIF statement is introduced b1 
and d3
> "magically" always read the same. However, when the e3 IIF is 
removed, b1
> and d3,read the way they are supposed too. Sometimes they are equal
> sometimes not, which is supposed to change the e3 IIF when in the 
AFL...
> 
> So I leave this problem to the AFL Gods...and may the FORCE BE WITH 
YOU!
> 
> 
> 
> Thanks