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

[amibroker] backtest: positions score and additional signals



PureBytes Links

Trading Reference Links

Hello,

I have the following formula problem:
The strategy should always filter the 5 worsest stocks in the
beginning of september. This stocks should be saved and a buy rule
sarts for this five stocks until next september. 
How do I save this 5 stocks? How do I add the buy rule?

Here is the game plan:
PosQty = Param ( "PosQty", 5, 1, 10, 1); // You can define here how
many open
SetOption("MaxOpenPositions", posqty );
PositionSize = -100/PosQty; // invest 100% of portfolio equity divided
by max.
shortMA=20//Optimize("MAlong",5,1,20,1)
;
longma=50//Optimize("MAlong",20,20,50,5)
;
Buy = Month()>=9 AND Cross(MA(C,kurzma),MA(C,Langma))
;
Sell = Month()==8
;
YearRoc = ROC(Close, 252);
PositionScore = 100-YearRoc;

Regrds,
supistarde