mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-17 04:38:10 +00:00
MtApi5: fixing checking backtesting mode
This commit is contained in:
@@ -3369,6 +3369,13 @@ namespace MtApi5
|
|||||||
_quotesWaiter.Set();
|
_quotesWaiter.Set();
|
||||||
|
|
||||||
QuoteList?.Invoke(this, new(quotes.Values.ToList()));
|
QuoteList?.Invoke(this, new(quotes.Values.ToList()));
|
||||||
|
|
||||||
|
_isBacktestingMode = IsTesting();
|
||||||
|
|
||||||
|
if (_isBacktestingMode)
|
||||||
|
{
|
||||||
|
BacktestingReady();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessExpertAdded(int handle)
|
private void ProcessExpertAdded(int handle)
|
||||||
@@ -3555,7 +3562,7 @@ namespace MtApi5
|
|||||||
throw new Exception("No connection");
|
throw new Exception("No connection");
|
||||||
}
|
}
|
||||||
|
|
||||||
var payloadJson = JsonConvert.SerializeObject(payload);
|
var payloadJson = payload == null ? string.Empty : JsonConvert.SerializeObject(payload);
|
||||||
Log?.Debug($"SendCommand: sending '{payloadJson}' ...");
|
Log?.Debug($"SendCommand: sending '{payloadJson}' ...");
|
||||||
|
|
||||||
var responseJson = client.SendCommand(expertHandle, (int)commandType, payloadJson);
|
var responseJson = client.SendCommand(expertHandle, (int)commandType, payloadJson);
|
||||||
@@ -3590,13 +3597,6 @@ namespace MtApi5
|
|||||||
|
|
||||||
Client?.NotifyClientReady();
|
Client?.NotifyClientReady();
|
||||||
|
|
||||||
_isBacktestingMode = IsTesting();
|
|
||||||
|
|
||||||
if (_isBacktestingMode)
|
|
||||||
{
|
|
||||||
BacktestingReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
Log?.Debug("OnConnected: finished");
|
Log?.Debug("OnConnected: finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user