Is the following strategy possible to write in MC.NET?
Everyday a set of 100 stocks is evaluated to a certain value as result (e.g. RSI). These stocks are then ranked/sorted by that value and the strategy should issue buy or sell orders on up to 10 stocks on the list (highest ranked and above a treshold). The strategy should also consider how many open positions already exist. So when I'm already long in AAPL the strategy should only issue 9 orders to not exceed the maximum of 10 open positions.
What do you think, is such a type of system possible in MC.Net? The Portfolio backtest is not enough for me as I can't choose from stocks by ranking.
Strategy on ranked instruments
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Strategy on ranked instruments
If you can imagine it,Is the following strategy possible to write in MC.NET?
Everyday a set of 100 stocks is evaluated to a certain value as result (e.g. RSI). These stocks are then ranked/sorted by that value and the strategy should issue buy or sell orders on up to 10 stocks on the list (highest ranked and above a treshold). The strategy should also consider how many open positions already exist. So when I'm already long in AAPL the strategy should only issue 9 orders to not exceed the maximum of 10 open positions.
What do you think, is such a type of system possible in MC.Net? The Portfolio backtest is not enough for me as I can't choose from stocks by ranking.
if you can visualize it,
if you can quantify it,
if you can articulate it,
it can be coded.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Strategy on ranked instruments
Good question. I don't know if this is possible. In another thread, Dru provided a helpful code example to let indicators "talk to" strategies (see this post). I suspect the same framework can be used to let an instance of a strategy on instrument A talk with an instance of the strategy on instrument B.Is the following strategy possible to write in MC.NET?
Everyday a set of 100 stocks is evaluated to a certain value as result (e.g. RSI). These stocks are then ranked/sorted by that value and the strategy should issue buy or sell orders on up to 10 stocks on the list (highest ranked and above a treshold). The strategy should also consider how many open positions already exist. So when I'm already long in AAPL the strategy should only issue 9 orders to not exceed the maximum of 10 open positions.
What do you think, is such a type of system possible in MC.Net? The Portfolio backtest is not enough for me as I can't choose from stocks by ranking.
However, unless I'm doing it wrong, there's a big drawback with that implementation for your specific goal, and that is when a change is made in for example the 'information receiver' class, the strategy with the 'information sender' class isn't updated/reloaded in MC .NET. This might be related to this feature request, but in effect this would mean you have to remove the strategy from all 100 symbols and re-add it manually after every change to the code.
Perhaps it might be possible to create a singleton class (see this and this for example) to hold the strategy data. In other words, the strategy class will then send it's RSI values to the singleton class, from which the strategy class on another instrument 'pulls' the data from. (Note: so far I haven't been able to implement a singleton class in MC .NET, while it does work correctly in a VS console app. So this is purely theoretical speaking).
Hopefully some more experienced MC .NET users can provide some more helpful suggestions.