Rss & SiteMap

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

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

标题:请问高手:我的介入价止损代码对不对,是不是这样写

1楼
wphxl 发表于:2012/5/9 10:34:24

//建立多头的进场条件
long :=VBuy and time>=092700 and time<=150000;

if long then
 begin
 sellshort(holding < 0, 0, limitr, open);
 buy(holding = 0, 1, limitr, open);
 Price:=AVGENTERPRICE;//持仓价位
 SELL(HOLDING>0,HOLDING,Stopr,Price*0.9977);//止损
 end
//Price:=AVGENTERPRICE;//持仓价位
//画出多头的止损线
partline(holding>0,Price*0.9977,colorred);

//开空条件
short := VSell and time >= 092700 and time <= 150000;

if short then
 begin
 sell(holding > 0, 0, limitr, open);
 buyshort(holding = 0, 1, limitr, open);
 Price:=AVGENTERPRICE;//持仓价位
 sellshort(holding > 0, 0, Stopr,Price*1.0027);
 end

//画出空头的止损线
partline(holding<0, Price*1.0027, colorgreen);

//收盘前5分钟平仓
if time >= 151200 then
 begin
 sell(holding > 0, 0, limitr, open);
 sellshort(holding < 0, 0, limitr, open);
 end

2楼
jinzhe 发表于:2012/5/9 10:38:37
把止损单独写出来,和收盘前平仓那样
3楼
saintlucifer 发表于:2012/5/9 15:34:09
尽量不要用buy跟sell里面的止损指令,这个需要交易所支持的,外盘的大部分支持,但是国内的就大部分不支持,下了指令也没用,单子发不到交易所的,止损最好就像楼上说的,单独写出来作为一个平仓条件用
共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 1.65625 s, 2 queries.