Total Contracts  [SOLVED]

Questions about MultiCharts and user contributed studies.
Mydesign
Posts: 177
Joined: 15 Feb 2017
Has thanked: 32 times
Been thanked: 39 times

Total Contracts

Postby Mydesign » 16 Jun 2017

Hello,

How do I get this very basic information from a strategy: how many contracts have been traded in total ?

The performance report does not provide this info, and I can't figure out how to accurately calculate it, specially when doing some scaling In/out. Why there is not a keyword such as "TotalContracts" available in PowerLanguage while we do have "MaxContracts" or "CurrentContracts" ?

I tried to dig into positions in order to count contracts from each entries, but it does not work as expected. See my code attempt below:

Code: Select all

Vars: TotalQty(0), MP(0), Trade(0) ;

MP= marketposition ;

If MP <> MP[1] and MP[1] <> 0 then // when position closed
begin
For Trade = 0 to PosTradeCount(1)
begin
TotalQty = TotalQty + PosTradeSize(1, Trade) ;
end;
end;
Oh and BTW, what is the difference (if any) between PosTradeCount(1) and MaxEntries(1) ?

Many thanks for your help !

Mydesign
Posts: 177
Joined: 15 Feb 2017
Has thanked: 32 times
Been thanked: 39 times

Re: Total Contracts  [SOLVED]

Postby Mydesign » 19 Jun 2017

Nevermind, I finally found a solution, thanks to JoshM: viewtopic.php?f=1&p=47656#p47656

Yet, I find it very cumbersome to calculate the hard way such a trivial information, which should be easily available at least in the performance report. I have hard time to imagine that no one ever had the need to know for instance their average net profit / contract :roll:

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: Total Contracts

Postby Angelina MultiСharts » 19 Jun 2017

Hello Mydesign,

Can you please create a feature request for a TotalContracts keyword and post a link here?

Mydesign
Posts: 177
Joined: 15 Feb 2017
Has thanked: 32 times
Been thanked: 39 times

Re: Total Contracts

Postby Mydesign » 19 Jun 2017



Return to “MultiCharts”