Add test for dailysnapshot
This commit is contained in:
@@ -540,12 +540,12 @@ public static class TradingBox
|
||||
totalVolume += position.Open.Quantity * position.Open.Price * position.Open.Leverage;
|
||||
|
||||
// Add exit volumes from stop loss or take profits if they were executed
|
||||
if (position.StopLoss.Status == TradeStatus.Filled)
|
||||
if (position.StopLoss != null && position.StopLoss.Status == TradeStatus.Filled)
|
||||
{
|
||||
totalVolume += position.StopLoss.Quantity * position.StopLoss.Price * position.StopLoss.Leverage;
|
||||
}
|
||||
|
||||
if (position.TakeProfit1.Status == TradeStatus.Filled)
|
||||
if (position.TakeProfit1 != null && position.TakeProfit1.Status == TradeStatus.Filled)
|
||||
{
|
||||
totalVolume += position.TakeProfit1.Quantity * position.TakeProfit1.Price *
|
||||
position.TakeProfit1.Leverage;
|
||||
|
||||
Reference in New Issue
Block a user