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

    正文概述    2024-04-14 10:59:59  

    buycond:=ref(all(isup,3),1);
    buyshortcond:=ref(all(isdown,3),1);

    if myholding=0 and buycond then begin
    lots:=cash(0)/(open*multiplier*0.1);
    buy(1,lots,limitr,open);
    myholding:=lots;
    end

    if myholding=0 and buyshortcond then begin
    lots:=cash(0)/(open*multiplier*0.1);
    buyshort(1,lots,limitr,open);
    myholding:=-lots;
    end

    if myholding>0 and time=closetime(0) then begin
    sell(1,myholding,limitr,close);
    myholding:=0;
    end

    if myholding<0 and time=closetime(0) then begin
    sellshort(1,myholding,limitr,close);
    myholding:=0;
    end

    ==================================

    源码解析:

    输出 RUNMODE:0
    输出 VARIABLE:MYHOLDING=0
    BUYCOND赋值:昨日ALL(ISUP,3)
    BUYSHORTCOND赋值:昨日ALL(ISDOWN,3)
    LOTS赋值:CASH(0)/(开盘价*MULTIPLIER*0.1)
    BUY(1,LOTS,LIMITR,开盘价)
    MYHOLDING赋值:LOTS
    LOTS赋值:CASH(0)/(开盘价*MULTIPLIER*0.1)
    BUYSHORT(1,LOTS,LIMITR,开盘价)
    MYHOLDING赋值:-LOTS
    END 逻辑判断 MYHOLDING>0 AND 时间=CLOSETIME(0) THEN BEGIN SELL(1,MYHOLDING,LIMITR,收盘价)
    MYHOLDING赋值:0
    END 逻辑判断 MYHOLDING<0 AND 时间=CLOSETIME(0) THEN BEGIN SELLSHORT(1,MYHOLDING,LIMITR,收盘价)
    MYHOLDING赋值:0
    END

    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 金字塔红黑三兵交易系统源码 加入收藏