Hello,

You can either
a) turn ON "Allow position shrinking" - that will allow to open highest ranked 
position albeit with adjusted size to fit available funds
b) use custom backtest to detect such circumstance and assign -1 to price.

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-07-20 18:24, Tavan Taban wrote:


Hello,

Thank you Tomasz, for your clear and wise comments.

By the way, I remember more about the problem I experienced earlier. A fictive 
description of the problem is as follows.

Initial equity: 10000 (default)
Position Size: 5%
Highest ranked stock's price: 600
Assume 40 more signals.

Result:
Backtester rejects the highest ranked signal indicating insufficient funds and 
takes no trades.
The problem continues as this signal continues in raw mode backtest.

At that time, I passed off the subject by simply increasing the initial equity.
Walking towards perfection, perhaps you may consider handling different 
"insufficient funds" differently.

Best regards,
IK






2010/7/20 Tomasz Janeczko <[email protected] <mailto:[email protected]>>

    Hello,



    "While I have no idea what exactly does happen when I set sig.Price to -1 and 
why this works "

    It works because I coded it so. The internal code uses -1 as special marker 
to skip a signal.


    Best regards,
    Tomasz Janeczko
    amibroker.com <http://amibroker.com>

    On 2010-07-20 17:36, rise_t575 wrote:
    >
    >
    >
    >
    > Tomasz,
    >
    > While I have no idea what exactly does happen when I set sig.Price to -1 
and why this works, I can happily report that it *does* work - so thanks for
    the help!
    >
    > --- In [email protected] <mailto:amibroker%40yahoogroups.com>, Tomasz 
Janeczko<gro...@...> wrote:
    >> Hello,
    >>
    >> It is simple. By default AmiBroker opens positions in RANKED order (more 
preferred trades first).
    >> If at some point of going through the ranking it finds the trade that it 
can not open (for example
    >> due to insufficient funds) it will NOT open LOWER ranked trades because 
it is undesirable to have
    >> better candidates replaced by worse candidates when you run out of funds.
    >> When requested position size is non-zero and position size shrinking is 
ON AmiBroker will attempt
    >> to adjust pos size to lower value within user-defined constraints 
("MinShares", Round lot size).
    >> It will go down as far as constraints allow, but if it reaches the 
barrier or zero it will reject the trade
    >> and all lower-ranked signals.
    >> Setting signal's pos size to zero in the beginning effectively means the 
same condition.
    >>
    >> You should NOT set position size to zero if you want to reject single 
trade BUT continue to handle lower-ranked signals.
    >>
    >> If you want to SKIP one signal, without affecting others, you should set 
Price property of that signal to -1 (minus one).
    >>
    >> Best regards,
    >> Tomasz Janeczko
    >> amibroker.com <http://amibroker.com>
    >>
    >> On 2010-07-20 12:42, rise_t575 wrote:
    >>> Thanks a lot - I will try your solution.
    >>> Do you have an idea *why* this is happening?
    >>>
    >>> --- In [email protected] <mailto:amibroker%40yahoogroups.com>, Tavan 
Taban<tavantaban@> wrote:
    >>>> I remember experiencing the same problem earlier. As far as I 
remember, it
    >>>> is something like, if it cancels one, cancels also the rest which are 
not
    >>>> coded to be rejected. I can dig more if it helps.
    >>>>
    >>>> Anyway, one solution alternative may be the following.
    >>>>
    >>>> for( sig = bo.GetFirstSignal( bar ); sig; sig = bo.GetNextSignal( bar 
) )
    >>>> {
    >>>> if (IDontLikeThisSignal) sig.Type = 7;
    >>>> } // end if exit
    >>>>
    >>>>
    >>>> 2010/7/17 rise_t575<rise_t@>
    >>>>
    >>>>> Hello,
    >>>>>
    >>>>> I've noticed using mid-level CBT that when I set the position size to 
zero
    >>>>> for the signal in question (the reason for setting it to zero is 
slightly
    >>>>> complicated& not that important here - some data needed for a 
subsequent
    >>>>> calculation is {empty}), the trade is marked as "rejected" in AA's 
results
    >>>>> list (which is perfectly ok).
    >>>>> What is not "perfectly ok" is the fact that the backtester rejects the
    >>>>> following signals at the same bar as well (there's enough cash 
available and
    >>>>> position size is> 0).
    >>>>>
    >>>>> How can I prevent this?
    >>>>>
    >>>>>
    >>>>>
    >>>
    >>>
    >>> ------------------------------------
    >>>
    >>> **** IMPORTANT PLEASE READ ****
    >>> This group is for the discussion between users only.
    >>> This is *NOT* technical support channel.
    >>>
    >>> TO GET TECHNICAL SUPPORT send an e-mail directly to
    >>> SUPPORT {at} amibroker.com <http://amibroker.com>
    >>>
    >>> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
    >>> http://www.amibroker.com/feedback/
    >>> (submissions sent via other channels won't be considered)
    >>>
    >>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
    >>> http://www.amibroker.com/devlog/
    >>>
    >>> Yahoo! Groups Links
    >>>
    >>>
    >>>
    >>>
    >
    >
    >
    > ------------------------------------
    >
    > **** IMPORTANT PLEASE READ ****
    > This group is for the discussion between users only.
    > This is *NOT* technical support channel.
    >
    > TO GET TECHNICAL SUPPORT send an e-mail directly to
    > SUPPORT {at} amibroker.com <http://amibroker.com>
    >
    > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
    > http://www.amibroker.com/feedback/
    > (submissions sent via other channels won't be considered)
    >
    > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
    > http://www.amibroker.com/devlog/
    >
    > Yahoo! Groups Links
    >
    >
    >
    >





Reply via email to