您現在的位置:程序化交易>> 期貨公式>> (MC)multicharts>> MC知識>>正文內容

下列程序代碼編譯通不過,可能是其中的買賣語句有問題,請幫忙修改一下在MC上編譯能通過 [MC]

  • MC用戶求助:

    If (HH - LC) >= (HC - LL) Then Begin

    ?

    BuyRange = HH - LC;

    ?

    End Else Begin

    ?

    BuyRange = HC - LL;

    ?

    End;

    ?

    BuyTrig = K1*BuyRange;

    ?

    SellTrig = K2*SellRange;

    ?

    If MarketPosition = 0 Then Begin

    ?

    Buy at Open of next bar + BuyTrig Stop;

    ?

    Sell at Open of next bar - SellTrig Stop;

    ?

    End;

    ?

    If MarketPosition = -1 Then Begin

    ?

    Buy at Open of next bar + Buytrig Stop;

    ?

    End;

    ?

    If MarketPosition = 1 Then Begin

    ?

    Sell at Open of next bar - SellTrig Stop;

    ?

    End;

    ?

    End;

    ?

    ?

  • MC回復討論一:

    Inputs: K1(.5),K2(.5),Mday(1),Nday(1);

    Vars: BuyRange(0), SellRange(0);

    Vars: BuyTrig(0),SellTrig(0);

    Vars: HH(0),LL(0),HC(0),LC(0);

    If CurrentBar > 1 Then Begin

    HH = Highest(High,Mday);

    HC = Highest(Close,Mday);

    LL = Lowest(Low,Mday);

    LC = Lowest(Close,Mday);

    If (HH - LC) >= (HC - LL) Then Begin

    SellRange = HH - LC;

    End Else Begin

    SellRange = HC - LL;

    End;

    HH = Highest(High,Nday);

    HC = Highest(Close,Nday);

    LL = Lowest(Low,Nday);

    LC = Lowest(Close,Nday);

    If (HH - LC) >= (HC - LL) Then Begin

    BuyRange = HH - LC;

    End Else Begin

    BuyRange = HC - LL;

    End;

    BuyTrig = K1*BuyRange;

    SellTrig = K2*SellRange;

    If MarketPosition = 0 Then Begin

    Buy at Open of next bar + BuyTrig Stop;

    Sell at Open of next bar - SellTrig Stop;

    End;

    If MarketPosition = -1 Then Begin

    Buy at Open of next bar + Buytrig Stop;

    End;

    If MarketPosition = 1 Then Begin

    Sell at Open of next bar - SellTrig Stop;

    End;

    End;

    <!-- [if !supportLineBreakNewLine]-->
    <!--[endif]-->

    ?

  • MC回復討論二:

    Inputs: K1(.5),K2(.5),Mday(1),Nday(1);

    Vars: BuyRange(0), SellRange(0);

    Vars: BuyTrig(0),SellTrig(0);

    Vars: HH(0),LL(0),HC(0),LC(0);

    If CurrentBar > 1 Then Begin

    HH = Highest(High,Mday);

    HC = Highest(Close,Mday);

    LL = Lowest(Low,Mday);

    LC = Lowest(Close,Mday);

    If (HH - LC) >= (HC - LL) Then Begin

    SellRange = HH - LC;

    End Else Begin

    SellRange = HC - LL;

    End;

    HH = Highest(High,Nday);

    HC = Highest(Close,Nday);

    LL = Lowest(Low,Nday);

    LC = Lowest(Close,Nday);

    If (HH - LC) >= (HC - LL) Then Begin

    BuyRange = HH - LC;

    End Else Begin

    BuyRange = HC - LL;

    End;

    BuyTrig = K1*BuyRange;

    SellTrig = K2*SellRange;

    If MarketPosition = 0 Then Begin

    //Buy at Open of next bar + BuyTrig Stop;

    buy next bar at open next bar +buytrig stop;

    //Sell at Open of next bar - SellTrig Stop;

    sell next bar at open next bar -selltrig stop;

    End;

    If MarketPosition = -1 Then Begin

    //Buy at Open of next bar + Buytrig Stop;

    buy next bar at open next bar+buytrig stop;

    End;

    If MarketPosition = 1 Then Begin

    //Sell at Open of next bar - SellTrig Stop;

    sell next bar at open next bar -selltrig stop;

    End;

    End;

    特別說明:您的編譯的問題在于使用委托單的語句不當導致的,您可以看一下帖子https://forum.multicharts.cn/forum/cat/0/thread/33

    另外,open next bar-selltrig,這個數值實際是下一根bar的開盤價與selltrig的差。

 

有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友

可聯系技術人員 QQ: 511411198  點擊這里給我發消息進行 有償 編寫!不貴!點擊查看價格!


【字體: 】【打印文章】【查看評論

相關文章

    沒有相關內容
主站蜘蛛池模板: 男人边吃奶边做视频免费网站| 色www永久免费网站| 日韩国产在线观看| 人禽伦免费交视频播放| 香蕉视频久久久| 国产综合精品一区二区| 两个人在线观看的高清| 最近更新2019中文字幕国语4| 伊人久久综在合线亚洲91| 青青青国产精品国产精品美女| 国语对白一区二区三区| 中文字幕无码免费久久| 果冻传媒国产仙踪林欢迎你| 伊人久久波多野结衣中文字幕| 菠萝蜜视频在线看| 国产精品国三级国产av| www.爱爱视频| 无码免费一区二区三区免费播放| 亚洲人成伊人成综合网久久久| 男人和男人一起差差| 国产乡下三级全黄三级bd| 18分钟处破好疼高清视频| 奶水哺乳理论电影| 丰满亚洲大尺度无码无码专线 | 一个人hd高清在线观看免费直播 | 18禁白丝喷水视频www视频| 天海翼视频在线| 中文字幕一区二区三区乱码| 日韩伦理一区二区| 亚洲人成自拍网站在线观看| 澳门a毛片免费观看| 动漫美女www网站免费看动漫| 邻居少妇张开腿让我爽了在线观看 | 国产精品午夜电影| 99视频在线观看视频| 成人区人妻精品一区二区不卡视频| 久久国产欧美另类久久久| 欧日韩不卡在线视频| 亚洲欧美成人日韩| 男人j进女人p免费视频不要下载的 | 国产91在线九色|