PureBytes Links
Trading Reference Links
|
thanx for asking this question, it solved my problem that I posted
to the forum. Did not know using CUM() I can determine the barnumber
where a signal occurs. But it also slowed down my puter :-)
I speeded it up again by only calling CUM() when the condition is
true.
In your case:
ShortNum = IIf(shortsignal,Cum(ShortSignal),0);
DailyShortNum = IIf(shortnum>0,(ShortNum - ValueWhen
(NewDay,ShortNum)),0);
Maybe this will help?
enzo
--- In amibroker@xxxxxxxxxxxxxxx, "quexos0" <quexos0@xxxx> wrote:
>
> I'm currently using these codes to get auto backtester to buy/sell
> on the first signal generated during the day:
>
> -----------------------------
> LongSignal = xxx;
> ShortSignal = xxx;
>
> NewDay = DateNum() != Ref(DateNum(),-1);
> BuyNum = Cum(LongSignal);
> DailyBuyNum = BuyNum - ValueWhen(NewDay,BuyNum);
>
> ShortNum = Cum(ShortSignal);
> DailyShortNum = ShortNum - ValueWhen(NewDay,ShortNum);
>
> Buy = LongSignal AND DailyBuyNum == 1 AND DailyShortNum == 1;
> Short = ShortSignal AND DailyBuyNum == 1 AND DailyShortNum == 1;
> ------------------------------
>
> The Cum() function lags my amibroker a lot when used to backtest
> years of data.
> Any ideas to optimize these codes?
>
> Is there a shorter way to make amibroker detect signals as they
> happen intra-day and start afresh the next? (Like check for x
> occurrance of a pattern within each day)
>
> Thanks!!!
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> 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/
|