I've read through the Wiki on the keywords for the Portfolio Trader and the money management signal. Several times. After reading it and searching these forums, I believe my portfolio level stop loss code belongs in the strategy and not in the money management signal.
I have a portfolio of 10 symbols and 1 strategy. The strategy runs on 2 minute bars.
What I'm looking to do is close all positions in the portfolio when the total open profit falls below a certain level. I have a stop loss in my code for the individual instrument and a second exit based on the total open profit. My code is:
Code: Select all
if marketposition=1
and -1*pmms_strategy_openprofit(0) > PortfolioStop*.01*Portfolio_Equity
then
sell ("PortStopLX") next bar at market;
if marketposition=-1
and -1*pmms_strategy_openprofit(0) > PortfolioStop*.01*Portfolio_Equity
then
buytocover ("PortStopSX") next bar at market;
What am I missing?