PureBytes Links
Trading Reference Links
|
Hello,
Two lines will do that for you:
Pattern = Flip( Pattern, Sell );
Buy = Buy And Pattern;
You don't need to worry about excessive signals, becuase regular (not raw) mode
takes care about if for you
see "backtest modes" description at:
http://www.amibroker.com/guide/h_portfolio.html
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "pmxgs" <pmxgs@xxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, March 20, 2008 11:48 AM
Subject: [amibroker] Remove excessive buy signals
> Hi,
>
> I've been using AB for a short time so this question might be really
> easy to answer but I don't find a easy solution.
> example for the long signal:
> I'm trying to code a system that gets a signal when a candlestick
> pattern occurs, but I only want to buy when and if the price crosses
> the High plus 1 tick of the bar when the signal occurs (buystop
> order). This means that I may get a signal today but the trade is
> only triggered 5 days from now.
> I've created the variable pattern which is equal to 1 when the
> candlestick patterns occurs and zero when it doesn't.
> Then, I defined the buyprice as High + 1 tick and Buy=cross(H,Ref
> (buyprice,-barssince(pattern))).
> The sell is defined as two closes below MA.
> The first trade is ok, but then I keep getting new Buys even though
> pattern didn't occur again.
> Example:
> pattern: 000100000010000100000
> buy: 000001001000100101001
> sell: 010010100100001001000
> In this example I could only have at the maximum, three trades since
> it's the number of trues in pattern variable, but since the buy has
> several 1's I get more trades.
> The Exrem(buy,sell) is not enough to solve this because it doesn't
> take into account he pattern variable.
> I can only get a trade if I get a true in the pattern varable, and
> another trade can only happen if I get a new true again.
> I hope this is clear.
> Can someone give an hint?
>
> thanks
>
>
> ------------------------------------
>
> 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
>
>
>
------------------------------------
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
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|