大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人

您現(xiàn)在的位置:程序化交易>> 期貨公式>> (MC)multicharts>> MC知識(shí)>>正文內(nèi)容

求助代碼問題。 [MC]

  • MC用戶求助:

    [IntrabarOrderGeneration=False];

    Inputs:X(50);

    inputs: DataSeries1( Close of data1 ), DataSeries2( Close of data2 );

    variable:close1(0),var1(0),sell1(0),sell2(0),sell3(0),sell4(0),sell5(0),sell6(0),buy1(0),buy2(0),buy3(0),buy4(0),buy5(0),buy6(0);

    ?

    ?

    close1=DataSeries1-DataSeries2;

    ?

    ?

    ? var1=-150;

    ? ?sell1=var1+X;

    ? sell2=var1+2*X;

    ? ? sell3=var1+3*X;

    ? ? ? sell4=var1+4*X;

    ? ? ? ? sell5=var1+5*X;

    ? ? ? ? sell6=var1+6*X;

    buy1=var1-X;

    ? buy2=var1-2*X;

    ? buy3=var1-3*X;

    ? buy4=var1-4*X;

    ? buy5=var1-5*X;

    ? ? buy6=var1-6*X;

    ?

    condition1=Close1 cross over ?sell1;

    condition2=Close1 cross over sell2;

    condition3=Close1 cross over sell3;

    condition4=Close1 cross over ?sell4;

    condition5=Close1 cross over ?sell5;

    ?

    {condition11=Close1 < 200;

    condition21=Close1 < ?250;

    condition31=Close1 < 300;

    condition41=Close1 < ?350;

    condition51=Close1 < ? 400;}

    ?

    ?

    condition6=Close1 cross under buy1;

    condition7=Close1 cross under buy2;

    condition8=Close1 cross under buy3;

    condition9=Close1 cross under buy4;

    condition10=Close1 cross under buy5;

    ?

    ?

    ?

    {condition61=Close1 > buy1;

    condition71=Close1 > buy2;

    condition81=Close1 >buy3;

    condition91=Close1 > buy4;

    condition11=Close1 > buy5;}

    ?

    if ?condition1 then sellshort("s1") 1 contracts next bar at market;

    if condition2 then sellshort("s2") 1 contracts next bar at market;

    if ?condition3 ?then sellshort("s3") 1 contracts next bar at market;

    if ?condition4 ?then sellshort("s4") 3 contracts next bar at market;

    if ?condition5 ?then sellshort ("s5")6 contracts next bar at market;

    //if marketposition=1 and condition6 and currentcontracts=12 then sellshort 12 contracts next bar at market;

    if Close1[1] > sell4 ?and Close1 <= sell4 and marketposition=-1 then buytocover from entry("s5") next bar at market;

    if ?Close1[1] > sell3 ?and Close1 <= sell3 and marketposition=-1 ?then buytocover from entry("s4") ?next bar at market;

    if Close1[1] > sell2 ?and Close1<=sell2 and marketposition=-1 ?then buytocover from entry("s3") ?next bar at market;

    if Close1[1] > sell1 and Close1 <= sell1 and marketposition=-1 then buytocover ?from entry("s2") ? next bar at market;

    if Close1[1] > var1 and ?close1 <= var1 ?and marketposition=-1 ? then buytocover from entry("s1") next bar at market;

    if close1<150 ? then buytocover next bar at market;

    ?

    ?

    ?

    if ?condition6 ?then buy("b1") 1 contracts next bar at market;

    if condition7 then buy("b2") 1 contracts next bar at market;

    if ?condition8 ?then buy("b3") 1 contracts next bar at market;

    if ?condition9 ?then buy("b4") 3 contracts next bar at market;

    if ?condition10 ?then buy ("b5")6 contracts next bar at market;

    //if marketposition=1 and condition6 and currentcontracts=12 then sellshort 12 contracts next bar at market;

    if ?Close1[1] < buy4 and ?Close1 >= buy4 and marketposition=1 then buytocover from entry("b5") ?next bar at market;

    if ?Close1[1] < buy3 and ?Close1 >= buy3 and marketposition=1 ?then buytocover from entry("b4") ? next bar at market;

    if ?Close1[1] < buy2 and ?Close1 >= buy2 and marketposition=1 ?then buytocover from entry("b3") ?next bar at market;

    if ?Close1[1] < buy1 and ?Close1 >= buy1 and marketposition=1 then buytocover ?from entry("b2") ? next bar at market;

    if ? Close1[1] < var1 and ?Close1 >= var1 ?and marketposition=1 ? then buytocover from entry("b1") next bar at market;

    if close1>150 ? then sell next bar at market;

    ?

    我想實(shí)現(xiàn)類似網(wǎng)格策略,進(jìn)倉(cāng)點(diǎn)位正確,平倉(cāng)點(diǎn)位不正確。如何找出問題

    ?

  • MC回復(fù)討論一:

    https://forum.multicharts.cn/forum/cat/0/thread/33
    這個(gè)帖子有關(guān)于進(jìn)場(chǎng)出場(chǎng)語(yǔ)句的介紹,另外官網(wǎng)上有網(wǎng)格策略可以看一下。

    您可以在策略關(guān)鍵位置使用關(guān)鍵字print將該行相關(guān)的信息輸出出來(lái)進(jìn)行debug;或者使用commentry進(jìn)行debug

    從您的代碼來(lái)看,buytocover平倉(cāng)語(yǔ)句對(duì)應(yīng)的是空頭持倉(cāng),而sell平倉(cāng)語(yǔ)句對(duì)應(yīng)的是多頭持倉(cāng),這個(gè)地方在您的后半段的語(yǔ)句中是錯(cuò)誤的。

    對(duì)于您所說(shuō)的“進(jìn)場(chǎng)和平倉(cāng)點(diǎn)位不正確”,您需要將“不正確”敘述清楚,哪里不正確?

 

有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 511411198  點(diǎn)擊這里給我發(fā)消息進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價(jià)格!


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 国产精品久久久久久免费播放 | 久久尹人| 亚洲精品国产美女在线观看 | 一区二区三区免费在线 | 91热久久免费频精品动漫99 | 最新地址四虎www4hutv | 亚洲图欧美日韩色综合图 | 久久一区二区三区不卡 | 欧美韩日在线 | 91亚洲国产三上悠亚在线 | 亚洲成色999久久网站 | 四虎影午夜成年免费精品 | 另类av| 亚洲国产欧美国产综合一区 | 日本在线不卡免费视频一区 | 精品国免费一区二区三区 | 久久久久无码国产精品一区 | 亚洲一区二区三 | 国产一区二区三区免费在线观看 | 手机看片自拍日韩日韩高清 | 久久大香香蕉国产免费网vrr | 亚洲成年人在线观看 | 中文字幕一区久久久久 | 久久久一区二区三区不卡 | 国产欧美另类久久精品91 | 婷婷亚洲五月色综合 | 欧美精品99久久久久久人 | 91精品久久久久久久久久小网站 | 亚洲一区成人 | 国产精品久久久久久久伊一 | 欧美日韩成人午夜免费 | 国产一区二区三区视频 | 国产成人综合在线 | 国产日产综合 | 99热这就是里面只有精品 | 久久不射影院 | 九九精品热线免费观看6 | 天天干干干干 | 久久久久久亚洲精品影院 | 成人毛片18女人毛片免费96 | 7777奇米 |