請(qǐng)教ALEX這樣的策略能寫嗎? [MC]
-
MC用戶求助:
?
-
MC回復(fù)討論一:
?
-
MC回復(fù)討論二:
問題1:是的,因?yàn)檫@是初始風(fēng)險(xiǎn)
問題2:是的,6筆
問題3:是的,浮動(dòng)虧損10000就全部出場(chǎng)。計(jì)算在內(nèi)的,只要虧損10000就離場(chǎng),不贏不虧就不離場(chǎng)。
問題4:利潤寫錯(cuò)了,應(yīng)該是利潤達(dá)到150000就離場(chǎng)。
?
-
MC回復(fù)討論三:
input: in_loss(10000), num(5), lot(1);
var: flag(0), prof(0);
once (true) begin?
? ? ? ? for value2=1 to num+1 begin
? ? ? ? ? ? ? ? prof=prof+value2;
? ? ? ? end;
? ? ? ? prof=prof*10000;
end;
setstopposition;
setprofittarget(prof);
setstoploss(in_loss);
{condition1和condition2分別賦值為多頭進(jìn)場(chǎng)和空頭進(jìn)場(chǎng)的條件,需要您加一下}
if marketposition=0 and condition1 then
? ? ? ? buy("b_kaicang") lot shares next bar at market;
if marketposition=0 and condition2 then
? ? ? ? sellshort("s_kaicang") lot shares next bar at market;
flag=postradecount(0)-1;
value1=openentryprofit(flag);
if marketposition=1 and value1>=10000 then
? ? ? ? buy("b_jiacang") lot shares next bar at market;
if marketposition=-1 and value1>=10000 then
? ? ? ? sellshort("s_jiacang") lot shares next bar at market;
圖表策略屬性中屬性欄位中的部位限制,設(shè)置成最多允許6筆與目前倉位同向的進(jìn)場(chǎng),并且設(shè)置“無論委托是否由同一進(jìn)場(chǎng)語句產(chǎn)生。
?
-
MC回復(fù)討論四:
input: in_loss(10000), num(5), lot(1);
var: flag(0), prof(0);
once (true) begin?
? ? ? ? for value2=1 to num+1 begin
? ? ? ? ? ? ? ? prof=prof+value2;
? ? ? ? end;
? ? ? ? prof=prof*10000;
end;
setstopposition;
setprofittarget(prof);
setstoploss(in_loss);
{condition1和condition2分別賦值為多頭進(jìn)場(chǎng)和空頭進(jìn)場(chǎng)的條件,需要您加一下}
if marketposition=0 and condition1 then
? ? ? ? buy("b_kaicang") lot shares next bar at market;
if marketposition=0 and condition2 then
? ? ? ? sellshort("s_kaicang") lot shares next bar at market;
flag=postradecount(0)-1;
value1=openentryprofit(flag);
if marketposition=1 and value1>=10000 then
? ? ? ? buy("b_jiacang") lot shares next bar at market;
if marketposition=-1 and value1>=10000 then
? ? ? ? sellshort("s_jiacang") lot shares next bar at market;
圖表策略屬性中屬性欄位中的部位限制,設(shè)置成最多允許6筆與目前倉位同向的進(jìn)場(chǎng),并且設(shè)置“無論委托是否由同一進(jìn)場(chǎng)語句產(chǎn)生。
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容