python版 Dual Thrust OKCoin 期货
8
Follow
1361
Followers
Dual Thrust 策略包含完整的图表显示, 图表动态更新,模板引用等功能, 可做学习模板使用.
Source
Python
Strategy parameters
Related strategies
Comment
All comments (7)
def onTick:
................
if State == STATE_IDLE or State == STATE_SHORT:
if Bar['Close'] >= UpTrack:
msg = "做多,触发价:" + str(Bar['Close']) + "上轨" + str(UpTrack)
Log(msg)
Trade(State, STATE_LONG)
State = STATE_LONG
chart.add(1,{'x': Bar['Time'], 'color': 'red', 'shape': 'flag', 'title': '多', 'text': msg})
如果订单未成交,这边state=state_long,改变了state的值,会不会对策略造成影响
8 years ago
- 1

