×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

MaxPositionsAgo

467 bytes added, 13:59, 16 May 2012
Created page with "Returns the number of closed positions for the strategy on the current moment. ==Usage== <syntaxhighlight>Maxpositionsago; </syntaxhighlight> ==Note== This function can only..."
Returns the number of closed positions for the strategy on the current moment.

==Usage==
<syntaxhighlight>Maxpositionsago; </syntaxhighlight>

==Note==
This function can only be used in signals.

==Example==

Calculate the PnL for all closed positions up to the current moment.
<syntaxhighlight>
var: totalprofitloss(0), idx(0);
for idx = 1 to maxpositionsago begin
totalprofitloss = positionprofit(idx);
end;
</syntaxhighlight>

[[Category:Environment Information]]