Lean
$LEAN_TAG$
|
The TradeBuilder class generates trades from executions and market price updates More...
Public Member Functions | |
TradeBuilder (FillGroupingMethod groupingMethod, FillMatchingMethod matchingMethod) | |
Initializes a new instance of the TradeBuilder class More... | |
void | SetLiveMode (bool live) |
Sets the live mode flag More... | |
void | SetSecurityManager (SecurityManager securities) |
Sets the security manager instance More... | |
bool | HasOpenPosition (Symbol symbol) |
Returns true if there is an open position for the symbol More... | |
void | SetMarketPrice (Symbol symbol, decimal price) |
Sets the current market price for the symbol More... | |
void | ApplySplit (Split split, bool liveMode, DataNormalizationMode dataNormalizationMode) |
Applies a split to the trade builder More... | |
void | ProcessFill (OrderEvent fill, decimal securityConversionRate, decimal feeInAccountCurrency, decimal multiplier=1.0m) |
Processes a new fill, eventually creating new trades More... | |
Properties | |
List< Trade > | ClosedTrades [get] |
The list of closed trades More... | |
Properties inherited from QuantConnect.Interfaces.ITradeBuilder | |
List< Trade > | ClosedTrades [get] |
The list of closed trades More... | |
The TradeBuilder class generates trades from executions and market price updates
Definition at line 30 of file TradeBuilder.cs.
QuantConnect.Statistics.TradeBuilder.TradeBuilder | ( | FillGroupingMethod | groupingMethod, |
FillMatchingMethod | matchingMethod | ||
) |
Initializes a new instance of the TradeBuilder class
Definition at line 65 of file TradeBuilder.cs.
void QuantConnect.Statistics.TradeBuilder.SetLiveMode | ( | bool | live | ) |
Sets the live mode flag
live | The live mode flag |
Implements QuantConnect.Interfaces.ITradeBuilder.
Definition at line 75 of file TradeBuilder.cs.
void QuantConnect.Statistics.TradeBuilder.SetSecurityManager | ( | SecurityManager | securities | ) |
Sets the security manager instance
securities | The security manager |
Implements QuantConnect.Interfaces.ITradeBuilder.
Definition at line 84 of file TradeBuilder.cs.
bool QuantConnect.Statistics.TradeBuilder.HasOpenPosition | ( | Symbol | symbol | ) |
Returns true if there is an open position for the symbol
symbol | The symbol |
Implements QuantConnect.Interfaces.ITradeBuilder.
Definition at line 108 of file TradeBuilder.cs.
void QuantConnect.Statistics.TradeBuilder.SetMarketPrice | ( | Symbol | symbol, |
decimal | price | ||
) |
Sets the current market price for the symbol
symbol | |
price |
Implements QuantConnect.Interfaces.ITradeBuilder.
Definition at line 124 of file TradeBuilder.cs.
void QuantConnect.Statistics.TradeBuilder.ApplySplit | ( | Split | split, |
bool | liveMode, | ||
DataNormalizationMode | dataNormalizationMode | ||
) |
Applies a split to the trade builder
split | The split to be applied |
liveMode | True if live mode, false for backtest |
dataNormalizationMode | The DataNormalizationMode for this security |
Implements QuantConnect.Interfaces.ITradeBuilder.
Definition at line 141 of file TradeBuilder.cs.
void QuantConnect.Statistics.TradeBuilder.ProcessFill | ( | OrderEvent | fill, |
decimal | securityConversionRate, | ||
decimal | feeInAccountCurrency, | ||
decimal | multiplier = 1.0m |
||
) |
Processes a new fill, eventually creating new trades
fill | The new fill order event |
securityConversionRate | The current security market conversion rate into the account currency |
feeInAccountCurrency | The current order fee in the account currency |
multiplier | The contract multiplier |
Implements QuantConnect.Interfaces.ITradeBuilder.
Definition at line 188 of file TradeBuilder.cs.
|
get |
The list of closed trades
Definition at line 93 of file TradeBuilder.cs.