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

 


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

相關文章

    沒有相關內容
  主站蜘蛛池模板: 久久99蜜桃精品久久久久小说| 免费无毒片在线观看| 8天堂资源在线官网| 少妇粉嫩小泬喷水视频| 久久久久人妻一区精品果冻| 李莫愁好紧好湿好滑| 亚洲欧美日韩另类在线专区| 亚洲成人自拍网| 末成年美女黄网站色大片连接| 亚洲精品动漫人成3d在线| 看黄a大片免费| 国产97在线看| 这里只有精品网| 饥渴艳妇小说官途欲妇| 国精产品一品二品国精品69xx| 一区两区三不卡| 成人性生免费视频| 久久不见久久见免费视频7| 日韩欧美无线在码| 亚洲av无码片一区二区三区| 粗大白浊受孕h鞠婧祎小说 | 国产午夜福利精品一区二区三区| videos性欧美| 国产精品自在线拍国产手青青机版| JAPANESEHD熟女熟妇伦| 好男人视频在线观看免费看片| 中文字幕乱妇无码AV在线| 日产精品久久久久久久性色| 久久精品国产自在一线| 最近最新中文字幕| 亚洲一卡一卡二新区无人区| 欧美性xxxx禁忌| 亚洲国产视频网| 欧美日本中文字幕| 亚洲日本国产精华液| 欧美综合国产精品日韩一| 亚洲熟妇av一区二区三区下载 | 人妻在线无码一区二区三区| 精品一区二区AV天堂| 内射中出无码护士在线| 精品国产麻豆免费人成网站|