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

[amibroker] Re: Syntax Question



PureBytes Links

Trading Reference Links


buy=cond1 and cond2; Both will have to be true on the same day for 
the condition to be true.
> 
> If I want a buy signal if either is true, I would code:
> 
> buy=cond1 or cond2; this will be true if any of the conditions are 
true on the day.
> 
> What is the difference between those and:
> 
> buy=cond1;
> buy=cond2;
>  
   If the above was youre final buy statement, only the  buy=cond2;
 would be the actual buy condition, the last statement using the same 
variable name will be used. 

  if you used 


    buy=cond1;
    buy= buy and cond2;   the buy would need both conditions to be 
true on the same bar.

  or 

buy=cond1;
buy= buy or cond2;   the buy would need any of the  conditions to be 
true .


 e.g. 
cond1= cross(c,ma(c,20));
cond1= cond1 and rsi(14)>60;
buy=cond1;

The second cond1 line is using the cond1 condition in the formula, 
and then the second cond1 line is the buy condition.

Peter.
> I would be grateful if someone would set me straight 










--- In amibroker@xxxxxxxxxxxxxxx, "Sam Levy" <slevy1220@xxxx> wrote:
> Is the following correct?:
> 
> If I want a buy signal if both of two conditions are true, I would 
> code:
> 
> buy=cond1 and cond2;
> 
> If I want a buy signal if either is true, I would code:
> 
> buy=cond1 or cond2;
> 
> What is the difference between those and:
> 
> buy=cond1;
> buy=cond2;
> 
> I would be grateful if someone would set me straight on this.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make Money Online Auctions! Make $500.00 or We Will Give You Thirty Dollars for Trying!
http://us.click.yahoo.com/KXUxcA/fNtFAA/uetFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/