Limit Number of Open Positions in Portfolio Trader

Questions about MultiCharts and user contributed studies.
robz7575
Posts: 7
Joined: 17 Feb 2018
Has thanked: 1 time
Been thanked: 1 time

Limit Number of Open Positions in Portfolio Trader

Postby robz7575 » 23 Feb 2018

Hello, I have ONE strategy that trades lets say 50 stocks in Portfolio Trader. During non volatile markets the system on average would have 20 open trades at once. When markets are volatile it could have close to 50 open positions at once. I am trying to limit the max amount of open positions in the system using Portfolio Trader.


I have looked at the forums and docs but am still struggling to get this to work.

A simple example of the strategy code is below. Does anyone have the code to use in the Money Management signal for portfolio Trader to limit the system to x number of open positions? Do I need to add anything to the strategy code below or just the portfolio money management signal?

---------------------------------------------------------------

Code: Select all

inputs:  Price( Close ), Length( 14 ), OverSold( 30 ) ;
variables:  var0( 0 ) ;

var0 = RSI( Price, Length ) ;

condition1 = Currentbar > 1 and var0 crosses over OverSold ;
if condition1 then                                                                   
   Buy ( "RsiLE" ) next bar at market ;



if barssinceentry>10 then sell next bar market;
Last edited by robz7575 on 23 Feb 2018, edited 1 time in total.

User avatar
TJ
Posts: 7016
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 984 times
Been thanked: 2008 times

Re: Limit Number of Open Positions in Portfolio Trader

Postby TJ » 23 Feb 2018

See post #1 & post #2
viewtopic.php?t=11713

robz7575
Posts: 7
Joined: 17 Feb 2018
Has thanked: 1 time
Been thanked: 1 time

Re: Limit Number of Open Positions in Portfolio Trader

Postby robz7575 » 23 Feb 2018

Sorry first post on multi charts. I did an edit. Hopefully it is better

robz7575
Posts: 7
Joined: 17 Feb 2018
Has thanked: 1 time
Been thanked: 1 time

Re: Limit Number of Open Positions in Portfolio Trader

Postby robz7575 » 23 Feb 2018

TJ wrote:See post #1 & post #2
viewtopic.php?t=11713



Any thoughts on the original question I had? Thank you

User avatar
TJ
Posts: 7016
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 984 times
Been thanked: 2008 times

Re: Limit Number of Open Positions in Portfolio Trader

Postby TJ » 23 Feb 2018

Do a search with the keywords "portfolio" or "limit" and you will see the previous discussions on the topic.

robz7575
Posts: 7
Joined: 17 Feb 2018
Has thanked: 1 time
Been thanked: 1 time

Re: Limit Number of Open Positions in Portfolio Trader

Postby robz7575 » 23 Feb 2018

I have done that.


Return to “MultiCharts”