PureBytes Links
Trading Reference Links
|
Robert
If for instance you want a 3 bar window from occurence of each condition in
which the other condition may occur then you could try this:
BC1=BARSSINCE(COND)<=3 AND COND2;
BC2=BARSSINCE(COND2)<=3 AND COND;
BC=BC1 OR BC2;
buy=BC;
Vice-versa for sell signals.
Rakesh
On 1/2/07, cstdc5588 <cstdc5588@xxxxxxxxx> wrote:
>
> Hi All,
>
> I have written a simple program. When MACD and Signal cross over,
> while MA20 and MA50 cross over, and their directions are the same,
> the system gives the signal for buying or selling. Showed as
> following:
>
> Cond = Cross( MA(Close, 20), MA(Close, 50) );
> Cond1 = Cross( MA(Close, 50), MA(Close, 20) );
> Cond2 = Cross(MACD(12, 26), Signal(12, 26, 9));
> Cond3 = Cross(Signal(12, 26, 9), MACD(12, 26));
> Buy = Cond AND Cond2;
> Sell = Cond1 AND Cond3;
>
> For example: on the 1st day MA20 and MA50 cross over, on the 2nd day
> MACD and Signal cross over, and their directions are the same, at
> this point the system gives the signal for buying or selling.
>
> For another example: on the 1st day MACD and Signal cross over, on
> the 2nd day MA20 and MA50 cross over, and their directions are the
> same, at this point the system gives the signal for buying or selling.
>
> How to revise the above program in order to satisfy the conditions?
> Any help would be appreciated!
>
> Thanks,
> Robert
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.3/614 - Release Date: 1/2/2007 2:58 PM
|