The following code working in NT6,5 but does not work in NT7:
protected override void OnBarUpdate() { if (BarsInProgress == 1) { if (Bars.FirstBarOfSession) { // Store the strategy's prior cumulated realized profit and number of trades priorTradesCumProfit = Performance.AllTrades.TradesPerformance.Currency.CumProfit; } } } /// <summary> /// Called on each incoming execution /// </summary> protected override void OnExecution(IExecution execution) { if (BarsInProgress == 1) { if (Performance.AllTrades.TradesPerformance.Currency.CumProfit > priorTradesCumProfit ) {blokadaPierwszegoWybicia = true;} if (Performance.AllTrades.TradesPerformance.Currency.CumProfit <= priorTradesCumProfit) {blokadaPierwszegoWybicia = false;} } }
8/11/2010 8:11:00 AMprofit =11742.5
8/11/2010 8:11:00 AMblokadaPierwszegoWybicia =False
8/11/2010 8:11:00 AMpriorTradesCumProfit =11742.5
8/11/2010 8:12:00 AMprofit =15242.5
8/11/2010 8:12:00 AMblokadaPierwszegoWybicia =True
8/11/2010 8:12:00 AMpriorTradesCumProfit =11742.5
In NT7 flag do not change state:
8/11/2010 8:11:00 AMprofit =11237.5
8/11/2010 8:11:00 AMblokadaPierwszegoWybicia =False
8/11/2010 8:11:00 AMpriorTradesCumProfit =11237.5
8/11/2010 8:12:00 AMprofit =19382.5
8/11/2010 8:12:00 AMblokadaPierwszegoWybicia =False
8/11/2010 8:12:00 AMpriorTradesCumProfit =11237.5
How to fix this problem.
Rgds
Czarek.
Comment