I'm working a strategy in strategy analyzer. I get the trades list where I can find entry/exit time, entry/exit price, quantity,... but I cannot get stop loss and profit target prices. I'd like to export all this data to an excel to make some calculations, including stop loss and take profit.
So I'm trying to code something that list me entry, stop loss and take profit prices.
In OnExecutionUpdate, I've added this code either for long and short entries:
if (longEntry != null && execution.Order == longEntry) { Print(string.Format("{0} / longEntry = {1} / stopLossLong = {2}", Time[0], Position.AveragePrice, Position.ToString())); stoploss = SubmitOrderUnmanaged(...) takeprofit = SubmitOrderUnmanaged(...) }
So in OnOrderUpdate() I've added this code:
Print(Time[0] + "stopLossLong = " + stopPrice);
27/12/2016 4:00:00stopLoss = 143,995
27/12/2016 4:00:00stopLoss = 143,995
27/12/2016 4:00:00stopLoss = 143,995
27/12/2016 4:00:00stopLoss = 143,82
27/12/2016 4:00:00stopLoss = 143,82
27/12/2016 4:00:00stopLoss = 143,82
27/12/2016 4:00:00stopLoss = 143,995
27/12/2016 4:00:00stopLoss = 143,82
27/12/2016 4:00:00stopLoss = 143,82
27/12/2016 4:00:00stopLoss = 143,82
27/12/2016 4:00:00stopLoss = 0
27/12/2016 4:00:00stopLoss = 0
27/12/2016 4:00:00stopLoss = 0
27/12/2016 4:00:00stopLoss = 143,82
27/12/2016 4:00:00stopLoss = 143,82
27/12/2016 4:00:00stopLoss = 143,82
27/12/2016 5:00:00stopLoss = 143,82
Could you guide me the way to get a list with entry/exit time and price, stop loss and take profit prices? Is there a way to do this on strategy analyzer?
Comment