Hi, I am new to Quantopian. Please forgive me if I have ask some silly questions.
I want to get the daily close price.
Below is the code(simply for testing):
#Imports
import statsmodels.api as sm
import quantopian.pipeline.data
import numpy as np
import talib
import scipy
def initialize(context):
# SPY
context.assets = sid(8554)
def handle_data(context, data):
price_history = data.history(context.assets, fields="price", bar_count=20, frequency="1d")
record(price=price_history[-1])
and in custome data, i get spy = 273.52 on 2/11/2018(Friday) and 271.8 on 3/11/2018(Saturday)
while in tradingview platform, i get 271.89 on 2/11/2018 (Friday)and 273.39 on 5/2/2018(Monday)
- I notice there is one day lagging, i must be wrong in somewhere.
- there is a little difference, say 273.52 and 273.39 even no lagging.
- Why there s data in saturday? do i need to make some timezone setting?