Simple Portfolio Trading Simulation engine

Questions about MultiCharts .NET and user contributed studies.
whirl
Posts: 22
Joined: 16 Aug 2010
Has thanked: 4 times

Simple Portfolio Trading Simulation engine

Postby whirl » 16 Jan 2015

Hello Everyone,

I have a need to test my strategy but hopefully as realistic as can be in market situations. I am going to explain what it would need. Please let me know if it's possible with MC.net

I want to trade a portfolio of 100 stocks, say the SP100.
My account balance would start at $100,000 and I would select say 5 positions max. As a result of the parameters, it would automatically purchase the proper amount of shares, in this case up to 20% of the account balance per position.
By enabling the strategy, it would then enter and exit positions based on the strategy. It would enter either 1-5 positions depending if the criteria are hit. Once the max positions are reached, it will no longer enter new positions until a position is exited. It will calculate new positions based on profit/loss. If a position exited with a 5k profit, it will enter a new position based on the new account balance of 105k and enter 20% fo that and vice versa if a loss.

One additional feature needed would be a way to rank the symbols so it picks the best symbol to enter out of the ones that meet the entry criteria. So if there are currently 3 symbols in the portfolio, that means there is room for 2 more symbols. If 6 stocks fit the entry criteria, it will enter the best 2 based on ranking. If the ranking were based on say ADX indicator, it would pick the 2 with the highest ADX number.

This type of portfolio trading "engine" should be able to be backtested, optimized, walk-forward, and run live.

I feel this type of testing is important because it can simulate how the strategy would trade in different types of market environments.

Can something like this be built with Multicharts? I don't know all the capabilities but wanted to ask before I researched for weeks and then found out it's not possible. I am not a good programmer, but if it's possible and somebody can point in the right direction, either a link, or perhaps a template, or sample strategy that has the functions I need, would be very very appreciated.

Thanks so much.

Jeff

User avatar
fbertram
Posts: 166
Joined: 16 Oct 2014
Location: Seattle, USA
Has thanked: 36 times
Been thanked: 76 times
Contact:

Re: Simple Portfolio Trading Simulation engine

Postby fbertram » 17 Jan 2015

Hi Jeff,

While I am not overly familiar with the .Net version of Multicharts, I can tell you that I am successfully doing what you are describing with the EasyLanguage version.

Have a look here:
http://www.multicharts.com/trading-soft ... lio_Trader

There are also some examples how to use Portfolio Trader, have a look at these.


Cheers, Felix

whirl
Posts: 22
Joined: 16 Aug 2010
Has thanked: 4 times

Re: Simple Portfolio Trading Simulation engine

Postby whirl » 17 Jan 2015

Thank you Felix,

Ok, it's good to know that it can be done. I just have to play around with the code since I'm not that great at coding. I took a look at the link (thank you), but it doesn't give an example of how to actually integrate it what I need.

The problem I seem to have is getting the ranking/sorting to work with the portfolio trading and entering the right symbol based on the ranking.

Do you, or anyone have a sample code that I could look at, to integrate the ranking into the portfolio management strategy?

I am not asking for anyone's proprietary trading strategy, just the integrating of ranking into the trading. Either a website, or somebody's simple strategy (buy when 10ma crosses 30ma), just to look at how the code is written to integrate it.

Again, thanks so much.
Jeff

User avatar
fbertram
Posts: 166
Joined: 16 Oct 2014
Location: Seattle, USA
Has thanked: 36 times
Been thanked: 76 times
Contact:

Re: Simple Portfolio Trading Simulation engine

Postby fbertram » 17 Jan 2015

Hi Jeff,
Did you see the link to the samples at the bottom of the page I pointed you to?

Here is some sample code:
http://www.multicharts.com/trading-soft ... y_Examples

This code is in EasyLanguage (or PowerLanguage). If you are not great at coding that's what I would recommend to you instead of .Net... That's also what I am using myself.

Cheers, Felix

whirl
Posts: 22
Joined: 16 Aug 2010
Has thanked: 4 times

Re: Simple Portfolio Trading Simulation engine

Postby whirl » 17 Jan 2015

Thank you Felix,

I will take a look at them. However, I already purchased the .net version and I figured that would be more flexible in the long term as my needs may grow.
My friend who has more programming experience will help me w/ the general structure of it. However, he is not familiar w/ MultiCharts.net so that ranking part, I hope he can use the easylanguage sample you gave me, and somehow "convert" it to the .net version.

If there is a working sample of the ranking strategy that would be easier ;)

trying my best
Jeff

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Simple Portfolio Trading Simulation engine

Postby Henry MultiСharts » 23 Jan 2015

Hello Jeff,

There is a prebuilt working example of portfolio ranking system. Please see the following signals:
Portfolio_Rank_MM
Portfolio_Rank_Signal_Base

whirl
Posts: 22
Joined: 16 Aug 2010
Has thanked: 4 times

Re: Simple Portfolio Trading Simulation engine

Postby whirl » 23 Jan 2015

ok thank you, will look at it, and hope to incorporate it


Return to “MultiCharts .NET”