Add test for dailysnapshot

This commit is contained in:
2025-11-14 19:42:52 +07:00
parent 479fcca662
commit b60295fcb2
3 changed files with 702 additions and 27 deletions

View File

@@ -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;