MtApi5: fixing checking backtesting mode

This commit is contained in:
Viacheslav Demydiuk
2024-02-11 21:18:25 +02:00
parent 5c72c08fa6
commit 826e13db29
+8 -8
View File
@@ -3369,6 +3369,13 @@ namespace MtApi5
_quotesWaiter.Set();
QuoteList?.Invoke(this, new(quotes.Values.ToList()));
_isBacktestingMode = IsTesting();
if (_isBacktestingMode)
{
BacktestingReady();
}
}
private void ProcessExpertAdded(int handle)
@@ -3555,7 +3562,7 @@ namespace MtApi5
throw new Exception("No connection");
}
var payloadJson = JsonConvert.SerializeObject(payload);
var payloadJson = payload == null ? string.Empty : JsonConvert.SerializeObject(payload);
Log?.Debug($"SendCommand: sending '{payloadJson}' ...");
var responseJson = client.SendCommand(expertHandle, (int)commandType, payloadJson);
@@ -3590,13 +3597,6 @@ namespace MtApi5
Client?.NotifyClientReady();
_isBacktestingMode = IsTesting();
if (_isBacktestingMode)
{
BacktestingReady();
}
Log?.Debug("OnConnected: finished");
}