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

MC setstoploss止損后,就不能自動(dòng)開倉(cāng)了[MC公式]

相關(guān)標(biāo)簽:期貨與期權(quán)套利策略 、 期貨期權(quán)組合策略 、 期權(quán)與期貨的區(qū)別 、 中金所期貨期權(quán)學(xué)院 、 期貨期權(quán) 2017 、 中國(guó)期貨期權(quán)學(xué)院 、 期貨期權(quán)交易規(guī)則 、 期貨期權(quán)入門 、 期貨期權(quán)遠(yuǎn)期 、 期貨與期權(quán)論文 、 期貨期權(quán)是什么 、 豆粕期貨期權(quán)合約 、 期貨期權(quán)實(shí)戰(zhàn)2017 、 遠(yuǎn)期 期貨 期權(quán)的區(qū)別 、 中國(guó)金融期貨期權(quán)學(xué)院 、
? ?? ?你好,下面是我編寫的股指期貨代碼,現(xiàn)在有幾個(gè)問(wèn)題想請(qǐng)教一下。
? ?? ?1、以下的代碼有沒(méi)有地方可以簡(jiǎn)化?可以減少計(jì)算時(shí)間。
? ?? ?2、現(xiàn)在運(yùn)行中,setstoploss止損后,就不能自動(dòng)開倉(cāng)了,如果想止損后依然按條件自動(dòng)開倉(cāng),應(yīng)該怎么寫代碼?
? ???非常感謝!




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
?

?

?

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

?

 

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

可聯(lián)系技術(shù)人員 QQ: 511411198  有需要幫忙請(qǐng)點(diǎn)擊這里留言!!!進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價(jià)格!

 


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

相關(guān)文章

    沒(méi)有相關(guān)內(nèi)容
  主站蜘蛛池模板: 国产不卡视频在线观看| 女人扒开双腿让男人捅| 亚洲性无码av在线| 美女扒开尿口让男生捅| 国产精品乱码久久久久久软件| 一本色道久久综合狠狠躁篇| 春日野结衣女女| 亚洲色一区二区三区四区| 良妇露脸附生活照15| 国产福利vr专区精品| A∨变态另类天堂无码专区| 日日日天天射天天干视频| 亚洲另类无码专区丝袜| 男女一边摸一边做爽视频| 国产乱在线观看视频| 色吧亚洲欧美另类| 欧美裸体xxxx极品少妇| 国产一区二区三区精品视频| 18精品久久久无码午夜福利| 小受bl灌满白浊夹多人4p| 久久夜色精品国产尤物| 精品无码中出一区二区| 国产成人高清视频| 91精品国产综合久| 小小的日本电影在线观看免费版| 久久国产视频网| 欧美性猛交xxxx乱大交极品 | 欧美精品三级在线| 免费观看呢日本天堂视频| 2021免费日韩视频网| 好男人好资源在线观看免费播放高清| 久久五月激情婷婷日韩| 欧美一区二区影院| 亚洲福利在线看| 粉色视频下载观看视频| 国产aⅴ精品一区二区三区久久| 黑人操日本美女| 国产精品无码一区二区三级| aⅴ一区二区三区无卡无码| 成人免费观看网站| 久久中文字幕无码专区|