Skip to content

Commit

Permalink
Fixed critical bug. System.InvalidOperationException: Collection was …
Browse files Browse the repository at this point in the history
…modified. This error sometimes occurred when testing the robot on historical data.
  • Loading branch information
Papay committed Jan 26, 2018
1 parent 0bb79e9 commit 0632673
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions project/OsEngine/Entity/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using OsEngine.Market.Servers;

Expand Down Expand Up @@ -80,11 +81,7 @@ public decimal VolumeExecute
{
if (_trades != null && (_volumeExecute == 0 || _volumeExecuteChange))
{
_volumeExecute = 0;
foreach (var trade in _trades)
{
_volumeExecute += trade.Volume;
}
_volumeExecute = _trades.Sum(trade => trade.Volume);
_volumeExecuteChange = false;
return _volumeExecute;
}
Expand Down

0 comments on commit 0632673

Please sign in to comment.