Positions.ClosedTrades

Questions about MultiCharts .NET and user contributed studies.
HT101
Posts: 1
Joined: 10 Jun 2013

Positions.ClosedTrades

Postby HT101 » 11 Jun 2013

Code: Select all

if (Bars.LastBarOnChart/*&& Environment.Optimizing*/)
{
foreach (var p in Positions)
{
foreach (var c in p.ClosedTrades)
{
Output.WriteLine("{0},{1},{2},{3},{4},{5},{6}",
c.EntryOrder.Action.ToString(),
c.EntryOrder.Contracts,
c.EntryOrder.Time,
c.EntryOrder.Price,
c.ExitOrder.Time,
c.ExitOrder.Price,
c.Profit);

}
}
}
In the code above Profit returns with only half the commission and slippage I expect. For example if a trade lost $1.00 and I had set slippage to be 0.05 per trade and commission to be 0.01 per trade, I would expect Profit to be -1.12, however Profit returns -1.06. Is which is correct?

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

Re: Positions.ClosedTrades

Postby Henry MultiСharts » 13 Jun 2013

Hello HT101,

Correct Profit value is -1.12
however Profit returns -1.06.
This issue has been confirmed. It will be fixed in MultiCharts .NET 8.7 Release


Return to “MultiCharts .NET”