Add start and enddate when fetching the position history
This commit is contained in:
@@ -602,6 +602,7 @@ public class TradingBotBase : ITradingBot
|
||||
await LogWarning(
|
||||
$"❌ Position Never Filled\nNo position on exchange and no orders\nChecking position history before marking as canceled.");
|
||||
|
||||
// Position might be canceled by the broker
|
||||
// Check if position exists in exchange history with PnL before canceling
|
||||
bool positionFoundInHistory = await CheckPositionInExchangeHistory(positionForSignal);
|
||||
|
||||
@@ -1254,7 +1255,7 @@ public class TradingBotBase : ITradingBot
|
||||
async exchangeService =>
|
||||
{
|
||||
// Get position history from the last 24 hours
|
||||
var fromDate = DateTime.UtcNow.AddHours(-24);
|
||||
var fromDate = DateTime.UtcNow.AddHours(-1);
|
||||
var toDate = DateTime.UtcNow;
|
||||
positionHistory =
|
||||
await exchangeService.GetPositionHistory(Account, Config.Ticker, fromDate, toDate);
|
||||
@@ -2536,7 +2537,7 @@ public class TradingBotBase : ITradingBot
|
||||
async exchangeService =>
|
||||
{
|
||||
// Get position history from the last 24 hours
|
||||
var fromDate = DateTime.UtcNow.AddHours(-24);
|
||||
var fromDate = position.Date.AddMinutes(-5);
|
||||
var toDate = DateTime.UtcNow;
|
||||
positionHistory =
|
||||
await exchangeService.GetPositionHistory(Account, Config.Ticker, fromDate, toDate);
|
||||
|
||||
Reference in New Issue
Block a user