I am developing a strategy that takes only certain number of trades in a day or quits trading when certain profit target or stop loss occurred in a day. I am using the following code.
if (Bars.FirstBarOfSession)
{
priorTradesCount = Performance.AllTrades.Count;
priorTradesCumProfit = Performance.AllTrades.TradesPerformance.Currency.C umProfit;
}
if (Performance.AllTrades.TradesPerformance.Currency. CumProfit >= 200
|| Performance.AllTrades.TradesPerformance.Currency.C umProfit <= -400
|| Performance.AllTrades.Count > 1)
{
return;
}
But when I try to compile this code, it says that "The name Prior trades count does not exist in the current context". What am I doing wrong?
Comment