Please remove this post if completely off-topic here as it touches a little bit on AFL application in trading.
Let’s say that I have a list of 50 stocks that I monitor on a nighly basis. From that list I would like to buy 3 max that open above last week’s high. So trade at the open.
In Amibroker backester (please correct if wrong), we can handle this in either one of two ways:
1- Using PositionScore which essentially acts as a tie-breaker. We look at all gaps at the open from the list of 50 and retain the 3 with the highest score. Let’s say we use Ref(ROC(C,1),-1) as the score here.
So what Amibroker does during the backtest is looks at all gaps and buys the three with the largest value of ROC1 yesterday.
2- The second way is to create a rank of ROC1 for all symbols and retain the 3 with the highest value of Rank<=3.
Of course the trades vary a lot here because in (1) we look at gaps and if true take the highest three from the ones that gapped…whereas in (2) we look at the Rank<=3 and buy if they gap.
Coming to my question, if there any way to trade this strategy using the PositionScore method with minimal real-time action to enter trades and not be glued to the screen to execute trades?
The idea in my head is a type of IB Basket Orders that are executed in sequence from top to bottom until trade 3 is hit and then rest are cancelled.
I know that for 2) it’s pretty easy. We know which stocks we want to buy before the open. Place 3 buy stops good until open plus a few minutes and that’s it.
I know it’s stupid but it’s been puzzling me because the results I get for this strategy using the PositionScore method are wildly superior to the Ranking method.
Cheers and thanks for reading!