Remove Quandl from LEAN (#6110)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Remove Quandl from LEAN * Nit changes and CustomLiveDataFeedTests.cs * Resolve conflicts * Remove files related with Quandl * Fix bug * Fix QuantBookHistoryTests.cs * Fix bug * Fix bug * Fix unit tests * Try fix regression tests * Nit changes * Fix bug * Some of the requested changes * The missing changes * Requested changes * Nit changes * Revert "Nit changes" This reverts commit 9800bc5c34f3ac20e30bea7a92dd4a9867213bb5. * Nit changes * Fix bug * Requested changes * Missing file using Quandl to be removed * Nit changes * Not applied nit change * Nit change * Nit change * Add nasdaq-auth-code parameter in config.json * Remove 'quandl-auth-token' from config.json Co-authored-by: Martin-Molinero <martin@quantconnect.com>
This commit is contained in:
committed by
GitHub
parent
0c26d42561
commit
472f78cc53
@@ -12,10 +12,11 @@
|
||||
# limitations under the License.
|
||||
|
||||
from AlgorithmImports import *
|
||||
from HistoryAlgorithm import *
|
||||
|
||||
### <summary>
|
||||
### The algorithm creates new indicator value with the existing indicator method by Indicator Extensions
|
||||
### Demonstration of using the external custom datasource Quandl to request the VIX and VXV daily data
|
||||
### Demonstration of using the external custom data to request the IBM and SPY daily data
|
||||
### </summary>
|
||||
### <meta name="tag" content="using data" />
|
||||
### <meta name="tag" content="using quantconnect" />
|
||||
@@ -33,38 +34,30 @@ class CustomDataIndicatorExtensionsAlgorithm(QCAlgorithm):
|
||||
self.SetEndDate(2018,1,1)
|
||||
self.SetCash(25000)
|
||||
|
||||
self.vix = 'CBOE/VIX'
|
||||
self.vxv = 'CBOE/VXV'
|
||||
self.ibm = 'IBM'
|
||||
self.spy = 'SPY'
|
||||
|
||||
# Define the symbol and "type" of our generic data
|
||||
self.AddData(QuandlVix, self.vix, Resolution.Daily)
|
||||
self.AddData(Quandl, self.vxv, Resolution.Daily)
|
||||
self.AddData(CustomDataEquity, self.ibm, Resolution.Daily)
|
||||
self.AddData(CustomDataEquity, self.spy, Resolution.Daily)
|
||||
|
||||
# Set up default Indicators, these are just 'identities' of the closing price
|
||||
self.vix_sma = self.SMA(self.vix, 1, Resolution.Daily)
|
||||
self.vxv_sma = self.SMA(self.vxv, 1, Resolution.Daily)
|
||||
self.ibm_sma = self.SMA(self.ibm, 1, Resolution.Daily)
|
||||
self.spy_sma = self.SMA(self.spy, 1, Resolution.Daily)
|
||||
|
||||
# This will create a new indicator whose value is smaVXV / smaVIX
|
||||
self.ratio = IndicatorExtensions.Over(self.vxv_sma, self.vix_sma)
|
||||
# This will create a new indicator whose value is smaSPY / smaIBM
|
||||
self.ratio = IndicatorExtensions.Over(self.spy_sma, self.ibm_sma)
|
||||
|
||||
# Plot indicators each time they update using the PlotIndicator function
|
||||
self.PlotIndicator("Ratio", self.ratio)
|
||||
self.PlotIndicator("Data", self.vix_sma, self.vxv_sma)
|
||||
self.PlotIndicator("Data", self.ibm_sma, self.spy_sma)
|
||||
|
||||
# OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
|
||||
def OnData(self, data):
|
||||
|
||||
# Wait for all indicators to fully initialize
|
||||
if not (self.vix_sma.IsReady and self.vxv_sma.IsReady and self.ratio.IsReady): return
|
||||
if not (self.ibm_sma.IsReady and self.spy_sma.IsReady and self.ratio.IsReady): return
|
||||
if not self.Portfolio.Invested and self.ratio.Current.Value > 1:
|
||||
self.MarketOrder(self.vix, 100)
|
||||
self.MarketOrder(self.ibm, 100)
|
||||
elif self.ratio.Current.Value < 1:
|
||||
self.Liquidate()
|
||||
|
||||
# In CBOE/VIX data, there is a "vix close" column instead of "close" which is the
|
||||
# default column namein LEAN Quandl custom data implementation.
|
||||
# This class assigns new column name to match the the external datasource setting.
|
||||
class QuandlVix(PythonQuandl):
|
||||
|
||||
def __init__(self):
|
||||
self.ValueColumnName = "VIX Close"
|
||||
|
||||
Reference in New Issue
Block a user