[求助老師幫忙改成WH8的,謝謝 [文華財經]
-
咨詢內容:
?# 取開盤價
??? # 回測模式下,開盤價可以直接用history_n取到
??? if context.mode == 2:
??????? # 獲取當天的開盤價
??????? current_open = data['pen'.loc[context.N]
??????? # 去掉當天的實時數據
??????? data.drop(context.N, inplace = True)
??? # 如果是實時模式,開盤價需要用current取到
??? else:
??????? # 獲取當天的開盤價
??????? current_open = current(context.symbol)[0]['pen'
??? # 計算Dual Thrust 的上下軌
??? HH = data['igh'.max()
??? HC = data['lose'.max()
??? LC = data['lose'.min()
??? LL = data['ow'.min()
??? range = max(HH - LC, HC - LL)
??? context.buy_line = current_open + range * context.k1? # 上軌
??? context.sell_line = current_open - range * context.k2? # 下軌
def on_bar(context, bars):
??? # 取出訂閱的這一分鐘的bar
??? bar = bars[0]
??? # 取出買賣線
??? buy_line =? context.buy_line
??? sell_line = context.sell_line?
?來源:程序化99
-
文華技術人員:
?
HH:=HHV(H,DAYBARPOS);
LL:=LLV(L,DAYBARPOS);
LC:=REF(C,DAYBARPOS);
X:=MAX(ABS(HH-LC),ABS(LC-LL));
BUY_LINE:REF(O,DAYBARPOS-1)+2*X; SELL_LINE:REF(O,DAYBARPOS-1)-2*X;
?
?來源: www.tumamayizhan.com
-
文華客服:
?HC = data['lose'.max()
?
這個沒有改
?
- 網友回復: ?這句沒用,后續已經限制了。
有思路,想編寫各種指標公式,交易模型,選股公式,還原公式的朋友
可聯系技術人員 QQ: 262069696 或微信號:cxh99cxh99 進行 有償收費 編寫!
(注:由于人數限制,QQ或微信請選擇方便的一個聯系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)
相關文章
-
沒有相關內容