Portfolio Backtesting Issue

Questions about MultiCharts and user contributed studies.
ilt000
Posts: 52
Joined: 06 Apr 2010
Location: Italy
Has thanked: 6 times
Been thanked: 2 times

Portfolio Backtesting Issue

Postby ilt000 » 03 Jun 2011

Dear Support,

I have a 20 symbols bouquet, I need to select 2 of these 20 symbols to buy, based upon a specific tech analysis that I put over each one of them, then I compare the results, I rank them and I proceed with the purchase on a hourly base.

What I need to do is to translate this approach in MC and automate the trades and the position management , which is your advice to build it?

Many Thanks

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 302 times

Re: Portfolio Backtesting Issue

Postby Stan Bokov » 03 Jun 2011

This is sample code for ranking your symbols, and placing trades for x amount of money, dynamically calculated using BPV, with a couple of checks. If you want to buy only two, the you should add the appropriate condition.

Code: Select all

PortfolioEntriesPriority = //YOUR TECH ANALYSIS HERE _for example ( closeD(1) - openD(1) ) / openD(1);_

value1 = ( InitialCapital ) / ( close * bigpointvalue );

if Portfolio_InvestedCapital < YOUR AMOUNT then
if ( date <> date[1] ) then buy .5 * value1 contracts next bar market;

once cleardebug;
print(Portfolio_InvestedCapital)
regarding this:
What I need to do is to translate this approach in MC and automate the trades and the position management , which is your advice to build it?
If you are asking about portfolio trading capabilities in MultiCharts, automating this process for real trading is not currently possible. You can perform the trades manually after seeing the results, or request the portfolio trading feature in the PM. Portfolio trading is not really realistic until we complete the 64 bit infrastructure, because it's very memory intensive.

ilt000
Posts: 52
Joined: 06 Apr 2010
Location: Italy
Has thanked: 6 times
Been thanked: 2 times

Re: Portfolio Backtesting Issue

Postby ilt000 » 06 Jun 2011

Thank you very much,
I was actually able to rank and buy items based upon a tech analysis.
How can I manage to compare price of Stock X with price of Stock Y in the same portfolio?

Best Regards

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 302 times

Re: Portfolio Backtesting Issue

Postby Stan Bokov » 07 Jun 2011

You can add supporting instruments to each main instrument (up to 4 supporting instruments), and use data2, data3, data4, and data5 to compare them to your main symbol (data1). You can't compare the price of Stock X to more than 4 others right now.


Return to “MultiCharts”