GetTrades()

View as Markdown

Definition

Returns a TradeCollection object representing all trades that make up the specified position.

Method Return Value

A TradeCollection object.

Syntax

\<tradecollection\>.GetTrades(string instrument, string entrySignalName, int instance)

Parameters

ParameterDescription
instrumentAn instrument name such as “MSFT”
entrySignalNameThe name of your entry signal
instanceThe occurrence to check for (1 is the most recent, 2 is the 2nd most recent position, etc…)

Examples

1protected override void OnBarUpdate()
2{
3 TradeCollection myTrades = SystemPerformance.AllTrades.GetTrades("MSFT", "myEntrySignal", 1);
4 Print("The last position was comprised of " + myTrades.Count + " trades.");
5}