Hello,
How I love newbies coming in and immediatelly blaming the
software.
For your information: it works perfectly fine.
Before making such bold statements that something does not
work
you should start READING the docs CAREFULLY. Not just
"scanning" but carefully reading.
In REGULAR backtest mode, the side which is taken
depends
on whenever given signal generates BUY or SHORT
signal,
not on the value of position score.
The sign of positionscore
is ONLY USED to select between long/short in ROTATIONAL
TRADING.
In your case backtester opened short position on BUL.MI
because
a) it has SHORT == 1 on that bar
b) it has HIGHEST ABSOLUTE SCORE AMONG symbols that got SHORT
signal.
AmiBroker will use the absolute value of
PositionScore variable to decide which trades are
preferred.
With SeparateLongShort ranking it means that it will use
ABSOLUTE VALUE of position score
and perform separate rankings.
BUL.MI has score of 3.9698, absolute value of position score
is 3.9698
SPM.MI has score of -1.6726, absolue value is
1.6726.
Which is greater ?
Obviously BUL.MI
And that's why it was choosen.
If you want "worst negative" instead of absolue value for
SHORT trades you have to CODE IT
the following way:
score= PositionScore = Yield ; // your original
PositionScore = IIF( SHORT, 10000 - PositionScore,
PositionScore ); // offset score for short signals to ensure that absolute value
grows with more negative amount of score.
Best regards, Tomasz Janeczko amibroker.com
----- Original Message -----
Sent: Thursday, August 27, 2009 2:43
PM
Subject: [amibroker] Positionscore ...
problem !
I
wrote a simple trading system that buy the best stock and short the wrost
stock of my watchlist simultaneously at 9.15 am but the positionscore
function does not work properly !!!!!!!! (I use AmiBroker version
5.20)
SetBacktestMode( backtestRegularRaw ); SetOption(
"InitialEquity",20000); SetOption(
"SeparateLongShortRank",True); SetOption( "MaxOpenPositions",2);
SetOption( "MaxOpenLong",1); SetOption( "MaxOpenShort",1);
PositionSize=10000;
ApplyStop(0,0,0,0); ApplyStop(1,0,0,0); ApplyStop(2,0,0,0); SetTradeDelays(0,0,0,0); TimeFrameSet(in5Minute); Timeopen=TimeNum()==090500
; Timeclose=TimeNum()==172000
; Cieri=ValueWhen(Timeclose,C,2); Ooggi=ValueWhen(Timeopen,O,1); yield=((Ooggi
/ Cieri)-1)*100; score= PositionScore = Yield ;
Buy=Timeopen
AND score; Sell=Timeclose; Short=Timeopen AND
score; Cover=Timeclose; BuyPrice=O; SellPrice=C; ShortPrice=O; CoverPrice=C;
Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy); Short=ExRem(Short,Cover); Cover=ExRem(Cover,Short); Plot(C,"",colorBlack,styleCandle); _N(Title
= StrFormat("{{NAME}} - ANG Spread Ita System - {{INTERVAL}} {{DATE}} - Open
%g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}",
O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Filter=Buy AND
Short; AddColumn(yield,"yield",6.4);
you see in the image ... http://img44.imageshack.us/i/positionscore.png/
I've already this problem?
thanks for the
reply
Angio
__._,_.___
**** 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/
__,_._,___
|