import xarray as xr
import numpy as np
import pandas as pd
import qnt.data as qndata
import qnt.stats as qnstats
import qnt.graph as qngraph
import qnt.forward_looking as qnfl
data = qndata.load_cryptocurrency_data(min_date = "2013-05-01",
max_date = None,
dims = ("time", "field", "asset"),
forward_order = True)
output = xr.ones_like(data.loc[:, "close", ['BTC']])
stat = qnstats.calc_stat(data, output, max_periods = len(data.time), slippage_factor=0.05)
display(stat.to_pandas().tail())
qnstats.print_correlation(output, data)
qndata.write_output(output)