Can you please take a look and tell me if the values I`m providing to Performance.AllTrades.GetTrades is correct what value should I use ?
Here is an example of the code I used to print AvgMAE to the Output Window.
for (ijk = 0; ijk < Performance.AllTrades.Count; ijk++)
{
intTradeNum++;
theTrade = Performance.AllTrades[ijk];
Print(intTradeNum.ToString() + "..\t" + theTrade.ToString()
+ "..\t" + Performance.AllTrades.GetTrades(theTrade.Entry.Ins trument.ToString(), theTrade.Entry.Order.Name.ToString(), 1).Count
+ "..\t" + Performance.AllTrades.GetTrades(theTrade.Entry.Ins trument.ToString(), theTrade.EntryExecution.Name.ToString(), 1).TradesPerformance.Currency.AvgMae
);
}
Here is the output it produced. As you can see the GetTrades only works some of the time.
1.. Instrument='YM 12-15' EntryPrice=16255 ExitPrice=16216 Quantity=1 Market position=Long EntryTime='9/10/2015 1:58:00 AM' ExitTime='9/10/2015 2:50:00 AM' TotalProfitCurrency=$-199.04.. 1.. 210
2.. Instrument='YM 12-15' EntryPrice=16290 ExitPrice=16230 Quantity=1 Market position=Long EntryTime='9/10/2015 4:27:00 AM' ExitTime='9/10/2015 4:27:00 AM' TotalProfitCurrency=$-304.04.. 1.. 300
3.. Instrument='YM 12-15' EntryPrice=16311 ExitPrice=16251 Quantity=1 Market position=Long EntryTime='9/10/2015 5:54:00 AM' ExitTime='9/10/2015 7:24:00 AM' TotalProfitCurrency=$-304.04.. 0.. 0
4.. Instrument='YM 12-15' EntryPrice=16335 ExitPrice=16275 Quantity=1 Market position=Long EntryTime='9/10/2015 5:55:00 AM' ExitTime='9/10/2015 7:24:00 AM' TotalProfitCurrency=$-304.04.. 0.. 0
5.. Instrument='YM 12-15' EntryPrice=16344 ExitPrice=16284 Quantity=1 Market position=Long EntryTime='9/10/2015 7:24:00 AM' ExitTime='9/10/2015 7:24:00 AM' TotalProfitCurrency=$-304.04.. 0.. 0
6.. Instrument='YM 12-15' EntryPrice=16181 ExitPrice=16142 Quantity=1 Market position=Short EntryTime='9/10/2015 7:25:00 AM' ExitTime='9/10/2015 8:11:00 AM' TotalProfitCurrency=$190.96.. 0.. 0
7.. Instrument='YM 12-15' EntryPrice=16185 ExitPrice=16142 Quantity=1 Market position=Short EntryTime='9/10/2015 7:30:00 AM' ExitTime='9/10/2015 8:11:00 AM' TotalProfitCurrency=$210.96.. 0.. 0
8.. Instrument='YM 12-15' EntryPrice=16169 ExitPrice=16142 Quantity=1 Market position=Short EntryTime='9/10/2015 7:37:00 AM' ExitTime='9/10/2015 8:11:00 AM' TotalProfitCurrency=$130.96.. 0.. 0
9.. Instrument='YM 12-15' EntryPrice=16175 ExitPrice=16142 Quantity=1 Market position=Short EntryTime='9/10/2015 7:41:00 AM' ExitTime='9/10/2015 8:11:00 AM' TotalProfitCurrency=$160.96.. 0.. 0
I`ve uploaded a screen scrape of what the AvgMae for each trade should be using the output from the strategy analyzer
Thank you
Comment