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

RE: [amibroker] Re: Syntax Question



PureBytes Links

Trading Reference Links

Makes no sense to me, Dimitris.
Could we keep from confusing the troops by agreeing that
Buy = cond1;
Buy = cond2; 
should not and in fact does not result in Oaring the two statements?


Bob

-----Original Message-----
From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@xxxxxxxxx]
Sent: Monday, May 05, 2003 11:55 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Syntax Question


Bob,
The 
Buy = IIf(Cum(1)%20,0,1);
Buy = IIf(Cum(1)%42,0,1);
will produce Buy signals every 30 bars.
Try the
Buy=IIf(Cum(1)%20,0,1);
Buy=IIf(Cum(1)%30,0,1);
Filter=Buy;
AddColumn(Cum(1),"");
DT

>   -----Original Message-----
>   From: Bob Jagow [mailto:bjagow@x...]
>   Sent: Monday, May 05, 2003 5:55 PM
>   To: amibroker@xxxxxxxxxxxxxxx
>   Subject: RE: [amibroker] Re: Syntax Question
> 
> 
>   Looks like only the last assignment counts, Dimitris.
>   Try
>   ----
>   Buy = IIf(Cum(1)%20,0,1);
>   Buy = IIf(Cum(1)%42,0,1);
>   ----
>   On the other hand, there's always the chance that
>   ----
>   Buy = IIf(Cum(1)%20,0,1);
>   Do_it_now_Dammit;
>   Buy = IIf(Cum(1)%42,0,1);
>   ----
>   could trigger buys every 20 days as well as every 42 days.
> 
>   Regards,
>   Bob
> 
> 
>   -----Original Message-----
>   From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@x...]
>   Sent: Monday, May 05, 2003 10:18 AM
>   To: amibroker@xxxxxxxxxxxxxxx
>   Subject: [amibroker] Re: Syntax Question
> 
> 
> 
>   > -----Original Message-----
>   > From: Sam Levy [mailto:slevy1220@x...]
>   > Sent: Monday, May 05, 2003 8:48 AM
>   > To: amibroker@xxxxxxxxxxxxxxx
>   > Subject: [amibroker] Syntax Question
>   >
>   >
>   > 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;
> 
>   The main difference is that
>   buy=cond1 or cond2;
>   is one-line code  and
>   buy=cond1;
>   buy=cond2;
>   is two-line code.
>   AFL is executed line by line.
>   So, in the second case you ask
> 
>   buy=cond1;// buy when cond1 is true
>   buy=cond2;// buy when cond2 is true
>   AFL will go to the next statement with the last info : buy=cond2;
>   Sometimes, this property is useful :
> 
>   D=5;
>   M=MA(H,D);
>   PLOT(M,"",1,1);
>   D=10;
>   M=MA(H,D);
>   PLOT(M,"",2,1);
>   D=15;
>   M=MA(H,D);
>   PLOT(M,"",3,1);
>   will plot 3 different MAs, although only one is defined, namely M.
>   On the other side the
> 
>   D=5;
>   M=MA(H,D);
>   D=10;
>   M=MA(H,D);
>   D=15;
>   M=MA(H,D);
>   PLOT(M,"",1,1);
>   PLOT(M,"",2,1);
>   PLOT(M,"",3,1);
>   will plot 3 MAs identical to MA(H,15)
>   Dimitris Tsokakis
> 
> 
> 
> 
> 
> 
>   > I would be grateful if someone would set me straight on this.
>   >
>   >
>   >       Yahoo! Groups Sponsor
>   >
>   >
>   >
>   >
>   >
>   > Send BUG REPORTS to bugs@xxxx
>   > Send SUGGESTIONS to suggest@xxxx
>   > -----------------------------------------
>   > 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 the Yahoo! Terms of 
Service.
> 
> 
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   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/
> 
> 
> 
>         Yahoo! Groups Sponsor
> 
> 
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   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 the Yahoo! Terms of 
Service.



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/ 



------------------------ 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/