Type/to search

均线策略(python版)

Python
8
Follow
1363
Followers

均线策略(python版)教学性质,实盘慎用。

Source
Python
import types
def main():
    STATE_IDLE = -1
    state = STATE_IDLE
    initAccount = ext.GetAccount()
    while True:
        if state == STATE_IDLE :
            n = ext.Cross(FastPeriod,SlowPeriod) # 指标交叉函数
            if abs(n) >= EnterPeriod :
                opAmount = _N(initAccount.Stocks * PositionRatio,3)
                Dict = ext.Buy(opAmount) if n > 0 else ext.Sell(opAmount)
                if Dict :
Strategy parameters
Strategy parameters
入市快线周期
入市慢线周期
入市观察期
离市快线周期
离市慢线周期
离市观察期
仓位比例
轮询周期
Comment
All comments (4)

    iikuj

    7 years ago

    iikuj

    7 years ago

    第5行,为什么要用ext?这个是什么意思呢,小白求教

    9 years ago

    这个是 《python 版数字货币交易类库》 模板的一个导出函数。 img

    9 years ago
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)