本文整理汇总了Python中TicksUtile.assemble_bars_1min_basis方法的典型用法代码示例。如果您正苦于以下问题:Python TicksUtile.assemble_bars_1min_basis方法的具体用法?Python TicksUtile.assemble_bars_1min_basis怎么用?Python TicksUtile.assemble_bars_1min_basis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TicksUtile
的用法示例。
在下文中一共展示了TicksUtile.assemble_bars_1min_basis方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_weeklies
# 需要导入模块: import TicksUtile [as 别名]
# 或者: from TicksUtile import assemble_bars_1min_basis [as 别名]
def create_weeklies():
sym = 'SPX'
basisdur = '1day'
TicksUtile.assemble_dur_bars(date,sym,'1day','initialize','5secs')
TicksUtile.assemble_bars_1min_basis(date,sym,'1Week','bartobar',basisdur)
indlist = ['mcross','pivot','R','R2','S','S2']
threshold = 0.0
rpInd.create_states_files(sym,'1Week',date,threshold,indlist)
rpInd.create_states_files(sym,'1day',date,threshold,indlist)
示例2: fibbo_50retrace
# 需要导入模块: import TicksUtile [as 别名]
# 或者: from TicksUtile import assemble_bars_1min_basis [as 别名]
symbol_list = symdict.keys()
##symbol_list =['ES','EUR.USD']
barlistall = bardict.keys() ##
barlist =[]
barlist = ['1 Week']
##########################################
date = rpu_rp.todaysdateunix()
date = '20150905'
datehyphen = rpu_rp.todaysdatehypens(date)
##########################
import RP_Snapshot
sym = 'SPX'
##RP_Snapshot.snapshot_sym(sym,date)
basisdur = '1day'
TicksUtile.assemble_dur_bars(date,sym,'1day','initialize','5secs')
TicksUtile.assemble_bars_1min_basis(date,sym,'1Week','bartobar',basisdur)
indlist = ['mcross','pivot','R','R2','S','S2']
threshold = 0.0
rpInd.create_states_files(sym,'1Week',date,threshold,indlist)
rpInd.create_states_files(sym,'1day',date,threshold,indlist)
'''
def fibbo_50retrace(low,high,sym,perc) : # could also use a time range for a range of bars / add this to states per duration
retraceval = (high-low)/(100/perc)
return retraceval
def check_lines(linesfile,curprice,tolerance):
for l in linesfile:
diff = curprice - l[0]
if diff < tolerance:
lines.append(l[0])