人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

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

MC setstoploss止損后,就不能自動開倉了[MC公式]

相關標簽:期貨與期權套利策略 、 期貨期權組合策略 、 期權與期貨的區別 、 中金所期貨期權學院 、 期貨期權 2017 、 中國期貨期權學院 、 期貨期權交易規則 、 期貨期權入門 、 期貨期權遠期 、 期貨與期權論文 、 期貨期權是什么 、 豆粕期貨期權合約 、 期貨期權實戰2017 、 遠期 期貨 期權的區別 、 中國金融期貨期權學院 、
? ?? ?你好,下面是我編寫的股指期貨代碼,現在有幾個問題想請教一下。
? ?? ?1、以下的代碼有沒有地方可以簡化?可以減少計算時間。
? ?? ?2、現在運行中,setstoploss止損后,就不能自動開倉了,如果想止損后依然按條件自動開倉,應該怎么寫代碼?
? ???非常感謝!




inputs:p01(9999),p02(9999),p03(9999),p04(9999);
variables:co1(0),c02(0),c03(0),c04(0),d01(0),d02(0),d03(0),d04(0);
begin
co1=p01-0.2;
c02=p02-0.2;
c03=p03-0.2;
c04=p04-0.2;
d01=p01+0.2;
d02=p02+0.2;
d03=p03+0.2;
d04=p04+0.2;
if close cross above co1 and marketposition=0 then sellshort 1 contract next bar at market;
if close cross above c02 and marketposition=0 then sellshort 1 contract next bar at market;
if close cross above c03 and marketposition=0 then sellshort 1 contract next bar at market;
if close cross above c04 and marketposition=0 then sellshort 1 contract next bar at market;
if close cross under d01 and marketposition=0 then buy 1 contract next bar at market;
if close cross under d02 and marketposition=0 then buy 1 contract next bar at market;
if close cross under d03 and marketposition=0 then buy 1 contract next bar at market;
if close cross under d04 and marketposition=0 then buy 1 contract next bar at market;
if close cross above co1 and marketposition=1 then sellshort 1 contracts next bar at market;
if close cross above c02 and marketposition=1 then sellshort 1 contracts next bar at market;
if close cross above c03 and marketposition=1 then sellshort 1 contracts next bar at market;
if close cross above c04 and marketposition=1 then sellshort 1 contracts next bar at market;
if close cross above d01 and marketposition=-1 then buy 1 contract next bar at market;
if close cross above d02 and marketposition=-1 then buy 1 contract next bar at market;
if close cross above d03 and marketposition=-1 then buy 1 contract next bar at market;
if close cross above d04 and marketposition=-1 then buy 1 contract next bar at market;
if close cross under co1 and marketposition=1 then sellshort 1 contract next bar at market;
if close cross under c02 and marketposition=1 then sellshort 1 contract next bar at market;
if close cross under c03 and marketposition=1 then sellshort 1 contract next bar at market;
if close cross under c04 and marketposition=1 then sellshort 1 contract next bar at market;
if close cross under d01 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross under d02 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross under d03 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross under d04 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross above d01 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross above d02 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross above d03 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross above d04 and marketposition=-1 then buy 1 contracts next bar at market;
setstoploss(600);
if time>=1457 then
sell next bar at market;
buytocover next bar at market;
end
?

?

?

公式導入教程: 【通達信公式源碼導入方法教程】 【同花順公式源碼導入方法教程】 【大智慧新一代公式源碼導入方法教程

?

 

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

可聯系技術人員 QQ: 511411198  有需要幫忙請點擊這里留言!!!進行 有償 編寫!不貴!點擊查看價格!

 


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

相關文章

    沒有相關內容
  主站蜘蛛池模板: 国产综合第一页在线视频 | 国产精品一国产精品免费 | 国产成人精品午夜免费 | 一本久久综合亚洲鲁鲁五月天 | 香蕉视频污片 | 曰本一区二区三区 | 经典三级四虎在线观看 | 天天弄天天模 | 永久免费看黄 | 国产精品免费看香蕉 | 日韩伦理亚洲欧美在线一区 | 成人影院天天5g天天爽无毒影院 | 日本日b | 亚洲日韩aⅴ在线视频 | 久久天天躁狠狠躁夜夜呲 | 天天天天天天干 | 精品亚洲成a人片在线观看 精品亚洲成a人在线播放 | 亚欧视频在线 | 中文字幕日韩在线观看 | 欧美高清另类video | 最近最新好看的中文字幕2019 | 五月婷婷在线播放 | 国产一区亚洲二区 | 最近中文字幕免费国语 | 最近日本中文字幕免费完整 | 色综合久久久久久久久五月 | 欧美人成片免费看视频不卡 | 激情网站在线观看 | 日韩一级淫片 | 无遮挡h肉动漫在线观看日本 | 狠狠干香蕉| 中中文字幕亚州无线码 | 亚洲一区免费观看 | 日韩在线播放中文字幕 | 成人综合国产乱在线 | 色汉综合 | 黄色三级视屏 | 看黄网址在线观看 | 玖玖国产 | 三级黄色小视频 | 欧美亚洲欧美日韩中文二区 |