最新公告
  • 欢迎您光临九毛八公式指标网www.9m8.cn,本站全新改版试运行,期间内容全部免费,欢迎下载!欢迎加入本站VIP
  • 金字塔震荡交易系统策略源码

    正文概述    2024-04-14 11:00:06  
    if entertime and rsi =90 then begin
    sell(1,holding,limitr,close),orderqueue;
    buyshort(1,1,limitr,close),orderqueue;
    end

    if exittime then
    sell(1,holding,limitr,close);
    end

    if holding 0 then begin
    if entertime and rsi =10 then begin
    sellshort(1,holding,limitr,close),orderqueue;
    buy(1,1,limitr,close),orderqueue;
    end

    if exittime then
    sellshort(1,holding,limitr,close);
    end

    盈亏:asset,noaxis,colormagenta;
    收益:(asset-50000)/50000,linethick0;
    次数:totaltrade,linethick0;
    胜率:percentwin,linethick0;
    连亏:maxseqloss,linethick0;
    连赢:maxseqwin,linethick0;


    复制上述代码粘贴到到公式管理器

    源码解析:

    输出RUNMODE:0
    输出INPUT:P(5,1,60,1)
    LC赋值:昨收
    RSI赋值:收盘价-LC和0的较大值的P日[1日权重]移动平均/收盘价-LC的绝对值的P日[1日权重]移动平均*100
    ENTERTIME赋值:时间 =143000 AND 时间 =145500
    EXITTIME赋值:时间 =150000
    逻辑判断 HOLDING=0 THEN BEGIN 逻辑判断 ENTERTIME AND RSI =10 THEN BUY(1,1,LIMITR,收盘价)
    ENDIF HOLDING=0 THEN BEGIN 逻辑判断 ENTERTIME AND RSI =90 THEN BUYSHORT(1,1,LIMITR,收盘价)
    ENDIF HOLDING 0 THEN BEGIN 逻辑判断 ENTERTIME AND RSI =90 THEN BEGIN SELL(1,HOLDING,LIMITR,收盘价),ORDERQUEUE
    BUYSHORT(1,1,LIMITR,收盘价),ORDERQUEUE
    END 逻辑判断 EXITTIME THEN SELL(1,HOLDING,LIMITR,收盘价)
    ENDIF HOLDING 0 THEN BEGIN 逻辑判断 ENTERTIME AND RSI =10 THEN BEGIN SELLSHORT(1,HOLDING,LIMITR,收盘价),ORDERQUEUE
    BUY(1,1,LIMITR,收盘价),ORDERQUEUE
    END 逻辑判断 EXITTIME THEN SELLSHORT(1,HOLDING,LIMITR,收盘价)
    输出END盈亏:ASSET,NOAXIS,画洋红色
    输出 收益:(ASSET-50000)/50000,线宽为0
    输出次数:TOTALTRADE,线宽为0
    输出胜率:PERCENTWIN,线宽为0
    输出连亏:MAXSEQLOSS,线宽为0
    输出连赢:MAXSEQWIN,线宽为0

    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 金字塔震荡交易系统策略源码 加入收藏