欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 请老师帮忙写下股指代码

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有4008人关注过本帖树形打印复制链接

主题:请老师帮忙写下股指代码

帅哥哟,离线,有人找我吗?
jinzhe
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/12/26 17:11:32    Post IP:58.246.57.26[显示全部帖子]

编写中,请稍等


金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/12/26 17:28:04    Post IP:58.246.57.26[显示全部帖子]

oo:=valuewhen(date<>ref(date,1),open);//当天开盘价
tt:=time<=145500;//限定交易时间:在强平前开仓
if h>=oo+10*mindiff and tt then buy(holding=0,1,limitr,high);//超过当天开盘价+10点后,开多

if enterprice-l>=10*mindiff  and tt then sell(holding>0,0,market);//多单止损,止损10点

if l<=oo-10*mindiff then buyshort(holding=0,1,limitr,l);//低于当天开盘价-10点后,开空

if h-enterprice>=10*mindiff then sellshort(holding<0,0,market);//空单止损,止损10点

if holding>0 and hhv(h,enterbars+1)-enterprice>20*mindiff and l<=enterprice then sell(holding>0,0,market);//浮盈20点,回落到开仓价后平多

if holding<0 and enterprice-llv(l,enterbars+1)>20*mindiff and h>=enterprice then sellshort(holding<0,0,market);//浮盈20点,回落到开仓价后平多

if time>145500 then begin
 sellshort(1,0,market);
 sell(1,0,market);
end//收盘前平仓



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/12/27 9:00:52    Post IP:58.246.57.26[显示全部帖子]

我调试了一下,调试代码:

oo:=valuewhen(date<>ref(date,1),open);//当天开盘价
tt:=time<=145500;//限定交易时间:在强平前开仓

if enterprice-l>=10*mindiff and enterbars>0 and tt then 多止损:sell(holding>0,0,market);//多单止损,止损10点
if h>=oo+10*mindiff and tt then buy(holding=0,1,thisclose);//超过当天开盘价+10点后,开多

 

if h-enterprice>=10*mindiff and enterbars>0 then 空止损:sellshort(holding<0,0,market);//空单止损,止损10点
if l<=oo-10*mindiff  and tt then buyshort(holding=0,1,thisclose);//低于当天开盘价-10点后,开空


if holding>0 and hhv(h,enterbars+1)-enterprice>20*mindiff and l<=enterprice  and enterbars>0 then 多回落:sell(holding>0,0,market);//浮盈20点,回落到开仓价后平多

if holding<0 and enterprice-llv(l,enterbars+1)>20*mindiff and h>=enterprice  and enterbars>0 then 空回落:sellshort(holding<0,0,market);//浮盈20点,回落到开仓价后平多

if time>145500 then begin
 sellshort(1,0,market);
 sell(1,0,market);
end//收盘前平仓

 

 

发现是你的条件太容易满足,只要一天的行情是一路走高或者走低,那么开平仓条件都容易满足,导致了后面每根k线都有信号



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/12/27 9:26:21    Post IP:58.246.57.26[显示全部帖子]

oo:=valuewhen(date<>ref(date,1),open);//当天开盘价
tt:=time<=145500;//限定交易时间:在强平前开仓

if enterprice-l>=10*mindiff and enterbars>0 and tt then 多止损:sell(holding>0,0,market);//多单止损,止损10点
if h>=oo+10*mindiff and tt  and totaldaytrade<1 then buy(holding=0,1,thisclose);//超过当天开盘价+10点后,开多

 

if h-enterprice>=10*mindiff and enterbars>0 then 空止损:sellshort(holding<0,0,market);//空单止损,止损10点
if l<=oo-10*mindiff  and tt and totaldaytrade<1 then buyshort(holding=0,1,thisclose);//低于当天开盘价-10点后,开空


if holding>0 and hhv(h,enterbars+1)-enterprice>20*mindiff and l<=enterprice  and enterbars>0 then 多回落:sell(holding>0,0,market);//浮盈20点,回落到开仓价后平多

if holding<0 and enterprice-llv(l,enterbars+1)>20*mindiff and h>=enterprice  and enterbars>0 then 空回落:sellshort(holding<0,0,market);//浮盈20点,回落到开仓价后平多

if time>145500 then begin
 sellshort(1,0,market);
 sell(1,0,market);
end//收盘前平仓



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/12/27 10:20:56    Post IP:58.246.57.26[显示全部帖子]

多回落就是,绿色的那个箭头

我改了名字,



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部