[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

Hi Ara,

Monday, January 30, 2006, 3:59:17 PM, you wrote:

AK> Graham is on the right track ... I think I interpret your objective a little
AK> differently...

I'm not surprised that he is; that is usually the case.  ^_^  I'm
just pretty lost, however your patience below gives me something to
try.

Thanks,

Yuki

P.S.  I agree with you that it's an interesting thing.  It strikes me
as something that I don't know, that I would like to know. There is
every possibility that there is no connection between lots of setups
and an increase in good signal percentage, or any important change in
any of the other metrics we use to gauge a system.  But until I test,
I don't know that for sure; and from casual observation at least, it
seems that there *is* a connection.

The question is pretty basic, and boils down to whether individual or
collective circumstances might be more powerful indications for
increasing profit or decreasing risk. (Almost like the idea of
multiple time frames, but looking at quantity of market that is
prepared to possibly trade rather than looking at time.)

There probably is no simple answer to this idea, however, and the
next thing I will undoubtedly want to look at -- something I've
always noted casually but never have done any number crunching on --
would be a cluster of setups in a particular industry group (rather
than just a lot of setups more or less scattered here and there, but
still at least in some notable quantity), and whether that has any
bearing on backtest statistics versus just taking the signals
irregardless. I strongly suspect the second case may prove to be more
powerful than the first one.

One thing I know for sure (at least about my systems that is) ... a
larger than average quantity of actual signals (versus merely setups)
is in and of itself a very strong signal.  Of course, signals don't
come conveniently packaged with a total-number-today label. One never
knows whether the first signal of the day will be the last, or the
first of many.  Of course, if you have significantly few setups on
any given day, it is naturally impossible to get "a lot" of signals
that day, unless you want to consider the signal-to-setup ratio,
which I have not gotten around to yet, either.  But, lots of signals
on the same day is in and of itself a very good signal, as I say, and
that requires lots of setups in order to be possible. So there may
indeed be some relationships in these areas worth looking at -- if I
can ever figure out how to code.  ^_^

AK> I understand that you want to see how many stocks give you a setup on any
AK> given day. If you have a greater number of setups then a predetemined value,
AK> then you trade.

AK> Looks like you need to do 2 passes.
AK> 1. First pass to count the number of setups and store them in an ATC file,
AK> instead of trading.
AK> 2. Modify your code so it reads the ATC file you just wrote and then process
AK> your normal trade conditions.

AK> You can accomplish this by either modifying a couple of lines of code to
AK> change the operation or use a parameter to do the switching.

AK> TestMode = Param("TestMode",1,1,2,1);  //TestMode 1 writes the ATCs

AK> if  (TestMode==2)
AK> {
AK> Setups = Foreign(~ATC ... )  // read ATC file to determine if you should
AK> trade
AK> }


AK> Test code
AK> ....
AK> ...

AK> if  (TestMode==1)
AK> {
AK> Setups = AddToComposite(...
AK> }
AK> else
AK> {
AK> Buy = ... your "normal" criteria and TestMode == 2 and Setups >= you
AK> criteria for setups
AK> Sell = ...
AK> }


AK> It's an interesting concept.

AK> Ara

AK> ----- Original Message ----- 
AK> From: "Yuki Taga" <yukitaga@xxxxxxxxxxxxx>
AK> To: "Graham" <amibroker@xxxxxxxxxxxxxxx>
AK> Sent: Sunday, January 29, 2006 10:10 PM
AK> Subject: Re: [amibroker] counting setups and conditioning the buy on that
AK> count


>> Hi Graham,
>>
>> I'm not sure whether you misunderstood me or not Graham.  But I
>> didn't understand what you wrote, either.  ^^_^^
>>
>> What I want to do is compare my plain vanilla backtest, which would
>> take every signal in the trading basket every time there is a signal,
>> with a backtest in which *no* signals are taken unless there is a
>> certain number of setups.
>>
>> For example ...
>>
>> Let's say I can have anywhere from 0 to 50 setups on any given day.
>> Some of these will signal the next day, and some won't.  I can easily
>> run a backtest that tells me how well or poorly that system performs.
>>
>> But, now I want to try a type of optimization.  What I want to do is
>> prohibit all buys unless setups = x, and then see what the results
>> would be.  In other words, I can have 0 to 50 setups, but let's say
>> only 2 symbols setup on any given day.  I now want to test only
>> signals taken when there were only 2 setups, versus signals taken
>> when there were more setups.
>>
>> What I'm trying to do is discern whether or not this particular
>> system would work better, worse, or the same, if I restricted it
>> based on not taking trades at all when only a few symbols setup on a
>> given day.
>>
>> Now you know why I can't write the algorithm.  I can't even explain
>> it very well in English.  ^_-
>>
>> Yuki
>>
>> Monday, January 30, 2006, 1:17:20 PM, you wrote:
>>
>> G> Yuki
>> G> Did I misunderstand your query?
>> G> I took your mention of symbols as you wanting to count signals for all
>> G> the symbols on your watchlist for that AFL.
>>
>>
>> G> --
>> G> Cheers
>> G> Graham
>> G> AB-Write >< Professional AFL Writing Service
>> G> Yes, I write AFL code to your requirements
>> G> http://e-wire.net.au/~eb_kavan/ab_write.htm
>>
>>
>> G> On 1/30/06, Yuki Taga <yukitaga@xxxxxxxxxxxxx> wrote:
>> >> Hi Rakesh,
>> >>
>> >> I think, maybe, you best understand exactly what I am trying to do. I
>> >> apologize for not being clear enough if others misunderstood me.
>> >> Happens all the time. ^_-
>> >>
>> >> Basically, I have a two-step operation now.  1) run an EOD
>> >> exploration with a filter statement that selects setups.  2) buy
>> >> those setups the next day if they pass the requirements in the buy
>> >> statement.
>> >>
>> >> So, I guess I could define buytrigger as simply my exploration
>> >> filter, then get the count as you have done below, and amend my buy
>> >> statement to require a certain atcb number.
>> >>
>> >> Let me try this, and thanks to all who have responded.
>> >>
>> >> Yuki
>> >>
>> >> Monday, January 30, 2006, 12:16:54 PM, you wrote:
>> >>
>> >> RS> Something on these lines should be what you need if I have
AK> understood your
>> >> RS> conditions correctly:
>> >>
>> >>
>> >> RS> buytrigger=x;
>> >>
>> >> RS> atcb=atc(buytrigger);
>> >>
>> >> RS> buy=atcb>=n;
>> >>
>> >>
>> >> RS> R
>> >>
>> >> RS> On 1/30/06, Yuki Taga <yukitaga@xxxxxxxxxxxxx> wrote:
>> >> >>
>> >> >>  This is probably startlingly obvious to people who can program, but
AK> 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
AK> I
>> >> >> need to define a variable that will be the count, and I'm
AK> practically
>> >> >> home free.  But as I say, I don't know how to get that value
>> >> >> returned.
>> >> >>
>> >> >> Yuki




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