?
?
問(wèn)題1:是的,因?yàn)檫@是初始風(fēng)險(xiǎn)
問(wèn)題2:是的,6筆
問(wèn)題3:是的,浮動(dòng)虧損10000就全部出場(chǎng)。計(jì)算在內(nèi)的,只要虧損10000就離場(chǎng),不贏不虧就不離場(chǎng)。
問(wèn)題4:利潤(rùn)寫(xiě)錯(cuò)了,應(yīng)該是利潤(rùn)達(dá)到150000就離場(chǎng)。
?
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筆與目前倉(cāng)位同向的進(jìn)場(chǎng),并且設(shè)置“無(wú)論委托是否由同一進(jìn)場(chǎng)語(yǔ)句產(chǎn)生。
?
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筆與目前倉(cāng)位同向的進(jìn)場(chǎng),并且設(shè)置“無(wú)論委托是否由同一進(jìn)場(chǎng)語(yǔ)句產(chǎn)生。