示例#1
0
import BreezyBarb.Futures.folder as crff
from BreezyBarb.Utilities.folder import opj
import BreezyBarb.Utilities.frames as cruf
import BreezyBarb.Utilities.filters as crtf
import BreezyBarb.Utilities.pkgstdy as crup
import numpy as np

# test = crff.cr_ft_hs_ar.retrieve('es')
#
# crff.cr_ft_hs.name
#
# testd = sorted(list(set(test['Date'].values)))

x = opj(crff.cr_ft_hs.name, 'ES.npz')
x = cruf.DataFrame.from_bin(x)

# dummy data
x = np.random.random(20)
x[0:4] = np.nan
m = 5

import BreezyBarb.Stocks.folder as crsf

x = crsf.cr_pr_cl.retrieve('SPY')

Input = x['Close'].values
Periods = 50
UseLog = 0
BarCount = Input.shape[0]
PeriodsInt = int(Periods)
Lambda = 2/(Periods+1)
示例#2
0
import BreezyBarb.Utilities.frames as cruf
from BreezyBarb.Utilities.folder import DataDir, DataFolder, opj

cr_rt = DataFolder('Q:\\Data_BB\\Futures\\')
cr_un = DataFolder(opj(cr_rt.name, 'Universe'))
cr_ft = DataFolder(opj(cr_un.name, 'Futures'))
cr_sfx = DataFolder(opj(cr_un.name, 'SpotFX'))
cr_info = DataDir(opj(cr_un.name, 'Info'))


cr_dn = DataFolder('Q:\\CSI\\')
cs_dn_dl = DataDir(opj(cr_dn.name, 'Daily'))
cs_dn_hs = [opj(cr_dn.name, 'compugene_world-history1', 'compugene_world-history1'),
            opj(cr_dn.name, 'compugene_world-history2', 'compugene_world-history2'),
            # opj(cr_dn.name, 'compugene_world-history3', 'compugene_world-history3'),
            opj(cr_dn.name, 'compugene_world-history4', 'compugene_world-history4')]

cs_dn_sym = [opj(cr_dn.name, 'compugene_world-history1', 'SYMBOLS.txt'),
             opj(cr_dn.name, 'compugene_world-history2', 'SYMBOLS.txt'),
             # opj(cr_dn.name, 'compugene_world-history3', 'SYMBOLS.txt'),
             opj(cr_dn.name, 'compugene_world-history4', 'SYMBOLS.txt')]

cr_ft_hs = DataDir(opj(cr_ft.name, 'History'))
cr_sfx_hs = DataDir(opj(cr_sfx.name, 'History'))

cr_ft_hs_ar = DataDir(opj(cr_ft.name, 'HistoryArchive'))
cr_sfx_hs_ar = DataDir(opj(cr_sfx.name, 'HistoryArchive'))

cr_ft_hs_arc = DataDir(opj(cr_ft.name, 'HistoryArchiveCopy'))
cr_sfx_hs_arc = DataDir(opj(cr_sfx.name, 'HistoryArchiveCopy'))
示例#3
0
#             cruf.DataFrame.to_bin(xd, xf)
#         except:
#             print(sys.exc_info()[0])
#
#     def rename(self, xo, xn):  # untested
#         xf1 = self.path(xo)
#         xf2 = self.path(xn)
#         os.rename(xf1, xf2)
#
#     def remove(self, xo):  # untested
#         xf = self.path(xo)
#         if os.path.exists(xf):
#             os.remove(xf)

cr_rt = DataFolder('Q:\\Data_BB\\Stocks\\')
cr_un = DataDir(opj(cr_rt.name, 'Universe'))
cr_pr = DataFolder(opj(cr_rt.name, 'Prices'))
cr_pr_cl = DataDir(opj(cr_pr.name, 'Clean'))
cr_pr_dv = DataDir(opj(cr_pr.name, 'Divs'))
cr_pr_rw = DataDir(opj(cr_pr.name, 'Raw'))

cr_clus = [
    DataFolder(opj(cr_rt.name, 'Cluster_C')),
    DataFolder(opj(cr_rt.name, 'Cluster_E')),
    DataFolder(opj(cr_rt.name, 'Cluster_F')),
    DataFolder(opj(cr_rt.name, 'Cluster_H')),
    DataFolder(opj(cr_rt.name, 'Cluster_I')),
    DataFolder(opj(cr_rt.name, 'Cluster_T')),
    DataFolder(opj(cr_rt.name, 'Cluster_S')),
    DataFolder(opj(cr_rt.name, 'Cluster_M'))
]