当前位置: 首页>>代码示例>>Python>>正文


Python Market.load_data方法代码示例

本文整理汇总了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
开发者ID:nanojack,项目名称:fx,代码行数:11,代码来源:main.py

示例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
开发者ID:nanojack,项目名称:fx,代码行数:32,代码来源:advisors.py

示例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
    '''

开发者ID:nanojack,项目名称:fx,代码行数:31,代码来源:new_account.py


注:本文中的market.Market.load_data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。