Lean
$LEAN_TAG$
|
This alpha model is designed to rank every pair combination by its pearson correlation and trade the pair with the hightest correlation This model generates alternating long ratio/short ratio insights emitted as a group More...
Public Member Functions | |
PearsonCorrelationPairsTradingAlphaModel (int lookback=15, Resolution resolution=Resolution.Minute, decimal threshold=1m, double minimumCorrelation=.5) | |
Initializes a new instance of the PearsonCorrelationPairsTradingAlphaModel class More... | |
override void | OnSecuritiesChanged (QCAlgorithm algorithm, SecurityChanges changes) |
Event fired each time the we add/remove securities from the data feed More... | |
override bool | HasPassedTest (QCAlgorithm algorithm, Symbol asset1, Symbol asset2) |
Check whether the assets pass a pairs trading test More... | |
Public Member Functions inherited from QuantConnect.Algorithm.Framework.Alphas.BasePairsTradingAlphaModel | |
BasePairsTradingAlphaModel (int lookback=1, Resolution resolution=Resolution.Daily, decimal threshold=1m) | |
Initializes a new instance of the BasePairsTradingAlphaModel class More... | |
override IEnumerable< Insight > | Update (QCAlgorithm algorithm, Slice data) |
Updates this alpha model with the latest data from the algorithm. This is called each time the algorithm receives data for subscribed securities More... | |
Public Member Functions inherited from QuantConnect.Algorithm.Framework.Alphas.AlphaModel | |
AlphaModel () | |
Initialize new AlphaModel More... | |
Additional Inherited Members | |
Properties inherited from QuantConnect.Algorithm.Framework.Alphas.BasePairsTradingAlphaModel | |
HashSet< Security > | Securities [get] |
List of security objects present in the universe More... | |
Properties inherited from QuantConnect.Algorithm.Framework.Alphas.AlphaModel | |
virtual string | Name [get, set] |
Defines a name for a framework model More... | |
Properties inherited from QuantConnect.Algorithm.Framework.Alphas.INamedModel | |
string | Name [get] |
Defines a name for a framework model More... | |
This alpha model is designed to rank every pair combination by its pearson correlation and trade the pair with the hightest correlation This model generates alternating long ratio/short ratio insights emitted as a group
Definition at line 30 of file PearsonCorrelationPairsTradingAlphaModel.cs.
QuantConnect.Algorithm.Framework.Alphas.PearsonCorrelationPairsTradingAlphaModel.PearsonCorrelationPairsTradingAlphaModel | ( | int | lookback = 15 , |
Resolution | resolution = Resolution.Minute , |
||
decimal | threshold = 1m , |
||
double | minimumCorrelation = .5 |
||
) |
Initializes a new instance of the PearsonCorrelationPairsTradingAlphaModel class
lookback | Lookback period of the analysis |
resolution | Analysis resolution |
threshold | The percent [0, 100] deviation of the ratio from the mean before emitting an insight |
minimumCorrelation | The minimum correlation to consider a tradable pair |
Definition at line 44 of file PearsonCorrelationPairsTradingAlphaModel.cs.
|
virtual |
Event fired each time the we add/remove securities from the data feed
algorithm | The algorithm instance that experienced the change in securities |
changes | The security additions and removals from the algorithm |
Reimplemented from QuantConnect.Algorithm.Framework.Alphas.BasePairsTradingAlphaModel.
Definition at line 57 of file PearsonCorrelationPairsTradingAlphaModel.cs.
|
virtual |
Check whether the assets pass a pairs trading test
algorithm | The algorithm instance that experienced the change in securities |
asset1 | The first asset's symbol in the pair |
asset2 | The second asset's symbol in the pair |
Reimplemented from QuantConnect.Algorithm.Framework.Alphas.BasePairsTradingAlphaModel.
Definition at line 93 of file PearsonCorrelationPairsTradingAlphaModel.cs.