if I want to get the profit after closing a trade you help guide says to use the code:
// and prints out the profit as a percentage to the output window
if (Performance.AllTrades.Count > 1)
{
Trade lastTrade = Performance.AllTrades[Performance.AllTrades.Count - 1];
Trade firstTrade = Performance.AllTrades[0];
Print("The last trade profit is " + lastTrade.ProfitPercent);
Print("The first trade profit is " + firstTrade.ProfitPercent);
}
if the last trade is the last index number why the code is not?:
Trade lastTrade = Performance.AllTrades[Performance.AllTrades.Count];
Comment