示例#1
0
 def __init__(self, minuteChartPath, minuteChartExt, dailyChartPath, dailyChartExt, dailyGapExt, bestAlgosPath, bestAlgosExt):
 
    self.bc = lpl.Barchart()
    
    self.dailyChartPath = dailyChartPath
    self.dailyChartExt = dailyChartExt
    
    self.minuteChartPath = minuteChartPath
    self.minuteChartExt = minuteChartExt
    
    self.dailyGapExt = dailyGapExt
    
    self.bestAlgosPath = bestAlgosPath
    self.bestAlgosExt = bestAlgosExt
示例#2
0
    cn = lpl.ConnectBitStamp(service, currency, alt)
    cn.connectPublic()
elif service == "bitfinex":
    cn = lpl.ConnectBitFinex()
elif service == "eTrade":
    symbol = stock
    cn = lpl.ConnectEtrade(c, stocks, debug, verbose, marketDataType, sandBox,
                           offLine)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Initialize algorithm,  barcharts objects

stocks = stocks.split(",")

for stock in stocks:
    ba[stock] = lpl.Barchart()
    tr[stock] = lpl.Trends(d, lg[stock], cn, ba[stock], offLine, stock)
    lm[stock] = lpl.Limits(d, lg[stock], cn, ba[stock], offLine, stock)
    a[stock] = lpl.Algorithm(d, lg[stock], cn, ba[stock], tr[stock], lm[stock],
                             offLine, stock)
    pr[stock] = lpl.Price(a[stock], cn, usePricesFromFile, offLine,
                          a[stock].getMarketBeginTime())

print(str(ba))
print(str(a))

lg1 = lg[stocks[0]]
a1 = a[stocks[0]]
tr1 = tr[stocks[0]]
lm1 = lm[stocks[0]]
pr1 = pr[stocks[0]]
示例#3
0
# Setup connection to the exchange service

if service == "bitstamp":
    cn = lpl.ConnectBitStamp(service, currency, alt)
    cn.connectPublic()
elif service == "bitfinex":
    cn = lpl.ConnectBitFinex()
elif service == "eTrade":
    symbol = stock
    cn = lpl.ConnectEtrade(c, stock, debug, verbose, marketDataType, sandBox,
                           offLine)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Initialize algorithm,  barcharts objects

bc = lpl.Barchart()
tr = lpl.Trends(d, lg, cn, bc, offLine)
lm = lpl.Limits(d, lg, cn, bc, offLine)
pa = lpl.Pattern()
a = lpl.Algorithm(d, lg, cn, bc, tr, lm, pa, offLine, stock)
pr = lpl.Price(a, cn, usePricesFromFile, offLine, a.getMarketBeginTime())

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Initialize files

lg.info("Using " + pricesPath + " as prices file")

with open(debugPath, "a+", encoding="utf-8") as debugFile:
    debugFile.write(
        lg.infoStamp(a.getLiveProfileValues(d,
                                            clOptions.profileTradeDataPath)))