PureBytes Links
Trading Reference Links
|
Hi everyone ?
New to the group, so apologies if this has been asked before.
Having some issues with the new market-neutral features in the rotational backtester.
How can I force there to be equal number of longs and shorts regardless of the PositionScore output?
Best example I can think of is using a simple range-type indicator for determining position score that compares the close to the past 100 day high and low:
RangeStat = (Close-Low)/(High-Low)
The score above will only generate positive values and thus only longs entries in my portfolio backtest.
I could trick the output a little and subtract 0.50 for a better chance of having positive and negative values across securities, but if I am scanning highly correlated markets like the 9 S&P sector ETFs, then there is a pretty good chance of having PositionScores returned all with the same sign, and thus no offsetting longs and shorts.
If anyone has a workaround, or if I am missing something, please let me know.
Thanks in advance.
<AB Code Below >
EnableRotationalTrading();
NumberHeld = 3;
MaxPos=NumberHeld*2;
Lookback=200;
SetOption("SeparateLongShortRank",True);
SetOption("WorstRankHeld", NumberHeld);
SetOption("MaxOpenPositions", MaxPos);
SetOption("MaxOpenLong",NumberHeld);
SetOption("MaxOpenShort",NumberHeld);
RangeStat = (Close-LLV(Close,Lookback))/(HHV(Close,Lookback)-LLV(Close,Lookback))-0.50;
PositionScore = RangeStat;
------------------------------------
**** 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
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
<*> 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/
|