Fetch closed position to get last pnl realized
This commit is contained in:
@@ -41,4 +41,10 @@ public interface IExchangeProcessor
|
||||
Task<Trade> GetTrade(string reference, string orderId, Ticker ticker);
|
||||
Task<List<FundingRate>> GetFundingRates();
|
||||
Task<IEnumerable<Position>> GetPositions(Account account);
|
||||
|
||||
Task<List<Position>> GetPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null);
|
||||
}
|
||||
|
||||
@@ -209,6 +209,16 @@ namespace Managing.Infrastructure.Exchanges
|
||||
return processor.GetPositions(account);
|
||||
}
|
||||
|
||||
public Task<List<Position>> GetPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null)
|
||||
{
|
||||
var processor = GetProcessor(account);
|
||||
return processor.GetPositionHistory(account, ticker, fromDate, toDate);
|
||||
}
|
||||
|
||||
public async Task<List<Trade>> GetTrades(Account account, Ticker ticker)
|
||||
{
|
||||
var processor = GetProcessor(account);
|
||||
|
||||
@@ -42,5 +42,11 @@ namespace Managing.Infrastructure.Exchanges.Exchanges
|
||||
public abstract Task<Trade> GetTrade(string reference, string orderId, Ticker ticker);
|
||||
public abstract Task<List<FundingRate>> GetFundingRates();
|
||||
public abstract Task<IEnumerable<Position>> GetPositions(Account account);
|
||||
|
||||
public abstract Task<List<Position>> GetPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,6 +208,14 @@ public class EvmProcessor : BaseProcessor
|
||||
return await _evmManager.GetOrders(account, ticker);
|
||||
}
|
||||
|
||||
public override async Task<List<Position>> GetPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null)
|
||||
{
|
||||
return await _evmManager.GetPositionHistory(account, ticker, fromDate, toDate);
|
||||
}
|
||||
|
||||
#region Not implemented
|
||||
|
||||
|
||||
Reference in New Issue
Block a user