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

Re: [amibroker] Thomasz - Setting priority in Task Manager



PureBytes Links

Trading Reference Links

Hi Dave,

Yes, thanks, been *very* busy :-)

I hear what you're saying, but from the documentation:

"You can use new PositionScore variable to decide which trades should
be entered if there are more entry signals on different securities
than maximum allowable number of open positions or available funds. In
such case AmiBroker will use the absolute value of PositionScore
variable to decide which trades are preferred."

Nothing says it won't work if you have a buy signal on all stocks.  If
you have X maximum allowable open positions and a watchlist of Y
stocks, PositionScore should work with X+1 entry signals, also with
X+2, X+3, ... Y.  If not, at what point would it fail and why?  And if
there is a buy signal on all stocks, it would seem that the trades
taken would be the top X ranked by the absolute value of the
PositionScore variable. 
 
Not sure why you think it would be unknown when you bought.  If the
system tester did not somehow track this, how could it work with the
PositionScore variable at all?  And if it works with X+1 stocks,
why not with Y stocks?

With that said, the code I posted still doesn't work, LOL.  I'm
surprised about that plus the fact that so far nobody has explained
what's happening.  I must be missing some nuance.  Anyone care to
enlighten me?

--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx>
wrote:
> Hi Mark, been a while (:-)... Hope you're well.
> 
> I thought that an always-buy rule would work too, except that this
sell rule
> is like a trailing stop; it needs to know when you actually bought,
which I
> think we can't know while our code runs, since it depends on the
value of a
> stock's PositionScore vs the other stocks under test.
> 
> Roughly speaking, this rule sells when price falls a spec'd amount
below its
> highest value *since buy*. (It also has some "acceleration" built
in, some
> ApplyStop won't do it.) Can you think of a way to code that that
would work
> in this context?
> 
> Is anyone out there using the Osaka plugin? I haven't tried it yet,
so I
> could be on the wrong track, but for some reason I'm under the
impression
> that its 2D array sorting capabilities can help. Anyone?
> 
> Thanks,
> 
> Dave
>   After reviewing the portfolio-level backtesting tutorial, I would
have
>   thought you could use a buy condition that's true for all stocks
and
>   then narrow the field to the 20 stocks with the highest stochd
with
>   MaxOpenPositions and PositionScore as in the following code.  And
>   that the system tester would automatically link buys and sells,
>   where are the sells are based on your "custom AFL rule" (which I
>   arbitrarily made Sell=C<Ref(C,-3); here). But it doesn't seem to
work.
>   Does anyone know why?
> 
>   /*****
>   ** REGULAR PORTFOLIO mode
>   ****/
> 
>   SetOption("InitialEquity", 500000 );
>   SetTradeDelays(1,1,1,1);
>   SetOption("MaxOpenPositions", 20 ); // limit to 20;
>   PositionSize = -5;
>   Buy=C>0;//use a buy condition that is true for all stocks
>   Sell=C<Ref(C,-3);// your sell condition
>   // now use score to rank equities
>   PositionScore = StochD(14); // prefer stocks that have high
stochd;
> 
> 
>   --- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx>
>   wrote:
> 
>   > I'll try again to explain: Whenever there's uncommitted capital,
>   buy the
>   > stocks ranked the highest (by StochD for example) ON THAT DAY.
So
>   first bar,
>   > I'd buy the 20 stocks with the highest StochD, and hold each of
them
>   until
>   > it exits by a custom AFL rule based on entry price and time.
>   Whenever
>   > there's free capital, buy as many of the top StochD stocks as
>   there's room
>   > for in the position sizing.
>   >
>   > Make sense? When you buy, you're looking for the stocks ranked
>   highest THAT
>   > DAY, which will change every bar.
>   >
>   > I don't see how to do that in native AFL. I thought I'd seen an
>   example of
>   > something similar using the Osaka plugin (for its sorting
>   capability), but I
>   > don't know where.



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