您現在的位置:程序化交易>> 期貨公式>> (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  有需要幫忙請點擊這里留言!!!進行 有償 編寫!不貴!點擊查看價格!

 


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

相關文章

    沒有相關內容
  主站蜘蛛池模板: 欧美一级在线播放| 美女扒开大腿让我爽| 国产色a在线观看| 一级毛片**不卡免费播| 日本特黄特色免费大片| 亚洲人成网站在线观看青青| 波多野吉衣中文字幕| 免费看片免费播放| 美女裸免费观看网站| 国产午夜无码福利在线看网站| 亚洲成人自拍网| 国产精品老熟女露脸视频| AV无码小缝喷白浆在线观看| 小泽码利亚射射射| 中文字幕久精品免费视频| 日本另类z0zx| 久久综合丝袜日本网| 欧美丰满熟妇xxxx| 亚洲日韩av无码中文| 波多野吉衣免费一区| 国产成人精品999在线观看| 国产ts在线播放| yy4080李崇端60集视频| 成全视频在线观看免费看| 久久久久久久久女黄9999| 日韩卡一卡2卡3卡4| 久热国产在线视频| 最近更新中文字幕影视| 亚洲啪啪免费视频| 欧美性色欧美a在线播放| 亚洲欧洲自拍拍偷综合| 欧美黑人乱大交| 亚洲第一黄网站| 男人把j桶进女的屁股的动态 | 国内揄拍国内精品| 99精品国产在热久久无码| 天天做天天爱夜夜爽| 亚洲福利视频一区| 狠狠久久永久免费观看| 伊人久久中文大香线蕉综合| 男男车车的车车网站免费|