Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:开仓价高10档止赢,低5档止损,写一句语言

1楼
300qh 发表于:2011/1/26 19:49:51
开仓条件随意:开仓价高10档止赢,低5档止损,写一句语言怎么写?
2楼
z7c9 发表于:2011/1/26 20:18:18
以下内容为程序代码:

1 runmode:0;
2
3 if holding=0 then begin
4     buy(1,1,limitr,close);
5 end
6
7 if holding>0 then begin
8     sell(high>=enterprice+10*mindiff,holding,limitr,enterprice+10*mindiff);
9     sell(low<=enterprice-5*mindiff,holding,limitr,enterprice-5*mindiff);
10 end
3楼
300qh 发表于:2011/1/26 22:10:34

以上是否可以这样写:

1 runmode:0;
2 hhh:=high>=enterprice+10*mindiff

lll:=low<=enterprice-5*mindiff
3 if holding=0 then begin
4     buy(1,1,limitr,close);
5 end
6
7 if holding>0 then begin
8     sell(hhh,holding,limitr,enterprice+10);//如1元一档的品种,是否直接省略mindiff函数效果一样?
9     sell(lll,holding,limitr,enterprice-5);
10 end

4楼
z7c9 发表于:2011/1/27 8:57:20
以下是引用300qh在2011-1-26 22:10:34的发言:

以上是否可以这样写:

1 runmode:0;
2 hhh:=high>=enterprice+10*mindiff

lll:=low<=enterprice-5*mindiff
3 if holding=0 then begin
4     buy(1,1,limitr,close);
5 end
6
7 if holding>0 then begin
8     sell(hhh,holding,limitr,enterprice+10);//如1元一档的品种,是否直接省略mindiff函数效果一样?
9     sell(lll,holding,limitr,enterprice-5);
10 end

 

这种写法不对,enterprice返回的上次开仓价,要写在开仓之后。如果mindiff等于1,当然可以省略。

共4 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.08203 s, 3 queries.