Open PnL of Portfolio trader
-
- Posts: 21
- Joined: 08 Mar 2021
- Been thanked: 1 time
Open PnL of Portfolio trader
I have instrument "A" with Signal 1 assigned with it, and instrument "B" with Signal 2 assigned with it. instrument "B" will always enter into the opposite direction from instrument "A" in order to hedge the trade. However, I do not how to show the whole portfolio's open PnL in C# (MC.NET). I can only find something like: " StrategyInfo.OpenEquity - StrategyInfo.ClosedEquity " which return the open PnL from the "Strategy". However, what I need is the open PnL of the whole portfolio across the Portfolio Trader (Net Net of the open PnL in Portfolio Trader). Any tips please.
- Svetlana MultiCharts
- Posts: 645
- Joined: 19 Oct 2017
- Has thanked: 3 times
- Been thanked: 163 times
Re: Open PnL of Portfolio trader
Hello lewisthegood,
Please use Portfolio.OpenPositionProfit.
Please use Portfolio.OpenPositionProfit.
Code: Select all
using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
using ATCenterProxy.interop;
namespace PowerLanguage.Strategy {
public class Portfolio_OpenPositionProfit : SignalObject {
public Portfolio_OpenPositionProfit(object _ctx):base(_ctx){}
protected override void Create() {}
protected override void StartCalc() {}
protected override void CalcBar()
{
Output.WriteLine(" OpenPositionProfit {0}", Portfolio.OpenPositionProfit);
}
}
}
-
- Posts: 21
- Joined: 08 Mar 2021
- Been thanked: 1 time