本文整理汇总了Python中market.Market.load_data方法的典型用法代码示例。如果您正苦于以下问题:Python Market.load_data方法的具体用法?Python Market.load_data怎么用?Python Market.load_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类market.Market
的用法示例。
在下文中一共展示了Market.load_data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FxSystem
# 需要导入模块: from market import Market [as 别名]
# 或者: from market.Market import load_data [as 别名]
class FxSystem(object):
def __init__(self, pair, period, data_file):
self.market = Market(pair, period)
self.market.load_data(data_file)
self.account = Account(self.market)
def __repr__(self):
out = "Fx System Trading {0} {1}.".format(self.market, self.account)
return out
示例2: binary
# 需要导入模块: from market import Market [as 别名]
# 或者: from market.Market import load_data [as 别名]
Returns a value between -1 (indicating short signal)
and +1 (indicating long signal)
Return what when required signal unavailable?
Consider using sigmoid function to determine binary (ternary?) options
From linear data
'''
def __init__(self, market):
self.market = market
def CrossoverAnalyser(Analyser):
'''
Bases signal on crossover of EAC
'''
'''
add the indicators
need to implement indicators.INDICATOR_INFO
to matche number of columns and names against talib functions
'''
if __name__ == '__main__':
from market import Market, DATA_FILE
m = Market("GBPCAD", "10m")
m.load_data(DATA_FILE)
a = Advisor(m)
a.add_analysis(Analyser)
print a
示例3: Advisor
# 需要导入模块: from market import Market [as 别名]
# 或者: from market.Market import load_data [as 别名]
# profit - buy base / sell quote
if self.quote > 0.0:
profit = self.quote / self.market.get_ask()
else: # loss - sell base / buy quote
profit = self.quote / self.market.get_bid()
#print "Opened at {0}, closed at {1}".format(self.position['price'], price)
#print "PROFIT: {0} = {1}%".format(profit, 100*profit/self.position['price'])
return profit
class Advisor(object):
'''
Uses technical indicators to advise on trading decisions
'''
def __init__(self):
pass
if __name__ == "__main__":
market = Market("GBPCAD", "10m")
market.load_data(DATA_FILE)
account = Account(market)
'''
add the indicators
need to implement indicators.INDICATOR_INFO
to matche number of columns and names against talib functions
'''