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

Re: [amibroker] Re: Greybeard Topic - Sorting and Ranking Arrays



PureBytes Links

Trading Reference Links

> 1. Sig.PosScore is reported with opposite sign for Buy and Short
> signals, but there is only one formula in the code for PositionScore.
>   What is the explanation for this behavior, and is it documented
> anywhere?

Of course it is documented. Positive score - long, negative score - short.
http://www.amibroker.com/guide/afl/afl_view.php?name=enablerotationaltrading

All modes use this convention for consistency. Ranking is
done anyway using ABSOLUTE value of position score. So it does not
matter as far as ranking is considered.


> 
> 2.  Since Sell and Cover are set to 0, why are Sell and Cover signal
> lines present?
What do you mean with "signal lines are present"?
Where? In the code?
The code ignores sell/cover signals. They don't matter. It is not really trading system formula.
We just use sorting/ranking part of backtest. Rest is irrelevant.

> 
> 3.  Why does sig.PosScore come up empty for Sell and Cover signals?
That's obvious. Exits do NOT need score at all. Score is needed for ENTRIES
because only top-ranked entires are actually taken. Exits are not subject to scoring
because once you entered position you MUST exit it on valid exit signal (score does not matter).
So exit signals are not sorted and are all tracked so if there is any matching open
position the exit signal is always captured.


Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "progster01" <progster@xxxxxxxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, May 10, 2008 12:44 PM
Subject: [amibroker] Re: Greybeard Topic - Sorting and Ranking Arrays


> Experimenting with the code given above in this thread, I changed the
> output to include the signal type, and altered the signal setup like
> so (these are the altered lines only):
> 
> // experiment - produces 4 signals per symbol (types 1,2,3,4)
> // Short signal (type3) has PosScore negative of Long signal (type1)
> Buy=1; Sell=0; Short = 1; Cover = 0;
> SetBacktestMode( backtestRegularRawMulti ); 
> 
> Line = sig.Symbol + "," + sig.Type + "," + sig.PosScore + "\n";
> 
> 
> The output produced was like this:
> 
> Date : 1/9/2007
> AA,3,-67.0314
> AA,1,67.0314
> ...
> AA,2,{EMPTY}
> AA,4,{EMPTY}
> 
> etc. for other dates and symbols.
> 
> In the interest of understanding the custom backtest processing
> better, I have several questions.
> 
> 1. Sig.PosScore is reported with opposite sign for Buy and Short
> signals, but there is only one formula in the code for PositionScore.
>   What is the explanation for this behavior, and is it documented
> anywhere?
> 
> 2.  Since Sell and Cover are set to 0, why are Sell and Cover signal
> lines present?
> 
> 3.  Why does sig.PosScore come up empty for Sell and Cover signals?
> 
> Thanks to anyone who's got the experience with this to provide
> comments ...
> 
> 
> 
> 
> 
> 
> 
> ------------------------------------
> 
> 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
> Yahoo! Groups Links
> 
> 
> 

------------------------------------

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

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