How to run SetBacktestMode( backtestRotational ) for short trades instead of long ones?

0 votes
asked May 27, 2017 in AmiBroker by Baronetti
Hi!

I would like to run a system inverse to the long rotational common one. A system than depending of the ranking, enters short positions instead on buying. Any idea of the afl?

Thank you!

2 Answers

0 votes
answered May 27, 2017 by fxshrat (1,200 points)
edited May 27, 2017 by fxshrat
For entering short trades only -> PositionsScore has to be always negative. This is ensure by adding a large negative number. For example

PositionScore = -10000 + ROC( C, 252 );
0 votes
answered May 27, 2017 by admin (9,260 points)

Quote from the manual:

http://www.amibroker.com/guide/afl/enablerotationaltrading.html

The score (PositionScore) for all securities is calculated first. Then all scores are sorted according to absolute value of PositionScore. [...]The score has the following meaning:

  • higher positive score means better candidate for entering long trade
  • lower negative score means better candidate for entering short trade

So just make the PositionScore LESS than zero. That is all you need to do.

...