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

[amibroker] Assigning a # Value to multpile buy and sell criteria



PureBytes Links

Trading Reference Links

Im trying to develop a indicator that buys and/or sells when a 
certain number of points is reached(5 for example).  I know this is 
a very basic question, but I have tried everything I could think of 
(of which I'm sure you'll see with one glance at the code below).  

In the following, I was trying to assign a numerical value of 1 to 
the statement if it was infact true.

C1 = Close > Ref(Close, -15);
IIf(C1, 1, 0);
ResultC1 = WriteIf(C1, "1", "0");

In this case, I was trying to assign a numerical value of -1 to the 
statement if it were in fact true.

C2 = Close < Ref(Close, -15);
IIf( C2, 1, 0);
ResultC2 = WriteIf(C2, "-1", "0");


The idea being that if multiple criteria added up to a certain + or -
 value I would indicate a buy or sell.

I am very greatful to the members of this board for spending the 
time to help me.  

Regards, 

Chris