-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding an interface to find open trades from different sources
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using backtesting_engine_models; | ||
|
||
namespace backtesting_engine.interfaces; | ||
|
||
public interface IOpenTrades | ||
{ | ||
Task<int> Request(string symbol); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using backtesting_engine; | ||
using backtesting_engine.interfaces; | ||
using backtesting_engine_models; | ||
using Utilities; | ||
|
||
namespace backtesting_engine_operations; | ||
|
||
public class BacktestingOpenTrades : IOpenTrades | ||
{ | ||
|
||
protected readonly ITradingObjects tradeObjs; | ||
|
||
public BacktestingOpenTrades(ITradingObjects tradeObjs) | ||
{ | ||
this.tradeObjs = tradeObjs; | ||
} | ||
|
||
public Task<int> Request(string symbol) | ||
{ | ||
return Task.FromResult(tradeObjs.openTrades.Count); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters