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

Re: [amibroker] counting setups and conditioning the buy on that count



PureBytes Links

Trading Reference Links

It would probvabaly be best to use a composite to store the number of
signals you get
here is a hypothetical case where I want the count of Wednesdays
during this current year to be >2. I have set this to show the create
the composite (flag=16) and show results in an exploration. You could
also create the composite during scan

System = Cum(DayOfWeek()==3 AND Year()==Now(8));

AddToComposite( system, "~countdays", "C", 7+16 );

answer = Foreign("~countdays","C",1);
Condition = answer>2;
Buy=Condition;
Filter=DayOfWeek()==3;
AddColumn(answer,"answer",1);
AddColumn(Condition,"Condition",1);


--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


On 1/30/06, Yuki Taga <yukitaga@xxxxxxxxxxxxx> wrote:
> This is probably startlingly obvious to people who can program, but I
> am profoundly algorithmically challenged.  ^_^
>
> I have certain symbols that setup according to certain criteria.  I
> want to *count* those symbols on every trading day, and then base
> *any* buy on the *count* being at or above a certain number.
>
> For example, if I had only 20 setups on one day, I might write the
> buy to not allow any trades. But if I had 50 setups I might write to
> buy to take all of the eligible trades that day.
>
> I have no problem with my basic code for this system.  But I have no
> idea how to return a count of the eligibles for any day.  I suppose I
> need to define a variable that will be the count, and I'm practically
> home free.  But as I say, I don't know how to get that value
> returned.
>
> Yuki
>
>
>
>
> 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 other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

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