hyu2707 / goquantdata

python based trading engine for equities and cryptocurrency
1 stars 3 forks source link

[P0] data size not equal for some multiple symbols #35

Closed hyu2707 closed 4 years ago

hyu2707 commented 4 years ago
from datetime import datetime, timedelta
from pyclient import *
from entity.constants import *

gqalgo = GQAlgo(TRADING_ALPACA, DATASOURCE_ALPACA)
Universe = ['AMD', 'INTL']
interval = timedelta(days=250)
price_dict = gqalgo.algo_get_data(symbols=Universe,
                                  freq=FREQ_DAY,
                                  interval_timedelta=interval)
for symbol in Universe:
    print("[{}] shape:{}".format(symbol, price_dict[symbol].shape))

return different size:

[AMD] shape:(173, 7)
[INTL] shape:(174, 7)
hyu2707 commented 4 years ago
  1. test in local using above code
    price_dict = gqalgo.algo_get_data(symbols=Universe,
                                  freq=FREQ_DAY,
                                  interval_timedelta=interval,
                                  fill_nan_method="ffill")

return

[AMD] shape:(174, 7)
[INTL] shape:(174, 7)
  1. unittest