Rss & SiteMap

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

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

标题:简单的程序帮忙写

1楼
yhl99414 发表于:2013/3/22 8:21:13
第二根k线收盘价高于前面一根k线收盘价就开仓做多,
如果第二根k线收盘价低于前面一根k线收盘价了就做空。
不是做空就是做多,直到收盘平仓!
请帮忙的朋友,在开仓手数那里  编程写“单量”, 这样开仓手数的参数我自己可以调节!谢谢
[此贴子已经被作者于2013-3-22 8:22:29编辑过]
2楼
fly 发表于:2013/3/26 15:10:44

num:=1;//下单数量


//第二根k线收盘价高于前面一根k线收盘价就开仓做多---平空开多
long:=c>ref(c,1) and time>=090500 and time<145500;


if long then
begin
sellshort(holding<0,num,market);
buy(holding=0,num,market);
end

 

//如果第二根k线收盘价低于前面一根k线收盘价了就做空,平多开空
short:=c<ref(c,1)  and time>=090500 and time<145500;
if short then
begin
sell(holding>0,num,market);
buyshort(holding=0,num,market);
end

 

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

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


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