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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 老师,帮我写个模型。感激不尽

   

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


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

主题:老师,帮我写个模型。感激不尽

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


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
老师,帮我写个模型。感激不尽  发帖心情 Post By:2012/9/16 22:48:53 [显示全部帖子]

每天价格上涨A个点做多,下降A个点做空。

B个点的最初止损,C个点浮动止损,止损后反手。若连续亏损3次(注意不是止损,是亏损,不计算昨天的)直接平仓并且不反手。

 

所有交易D个点止盈,最后一小时不入场,最后两分钟平仓。

 

怎么写呢?老师!!!谢谢老师了。


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


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
  发帖心情 Post By:2012/9/17 10:05:20 [显示全部帖子]

每天按这个条件就做一次,老师。


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


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
  发帖心情 Post By:2012/9/17 10:20:06 [显示全部帖子]

老师,这个代码,会不会第三次亏损后反手,然后又平仓呢???

因为前面反手的代码中并没有加入亏损次数的限制。然后后面再平仓,也就是三次亏损后开仓后又立即平仓。


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


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
  发帖心情 Post By:2012/9/17 13:45:30 [显示全部帖子]

图片点击可在新窗口打开查看老师好人啊!!!!

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


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
  发帖心情 Post By:2012/9/17 15:26:38 [显示全部帖子]

老师,还在吗?程序写好了吗?


 回到顶部
帅哥哟,离线,有人找我吗?
漫步金字塔
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
  发帖心情 Post By:2012/9/18 14:40:23 [显示全部帖子]

老师,能不能留个联系方式啊!


 回到顶部
帅哥哟,离线,有人找我吗?
漫步金字塔
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
  发帖心情 Post By:2012/9/18 16:25:54 [显示全部帖子]

老师,代码有问题,计算hh是开多仓后的最高值,当开第二个多单时hh需要重新计算,不是今天最高点。下面是我写的代码,有些可能是我没有说清楚,请老师改正一下。

 

下面的代码,模拟测试的时候开仓平仓点不对,我想问问下面代码有问题吗?如果有,问题出在哪儿?

 

variable:n=0,m=0,a=0,hh=0,ll=100000,ykcs=0;;
oo:=valuewhen(date<>ref(date,1),open);
sx:=oo+5;
xx:=oo-5;
n:=barslast(holding=1)+1;
hh:=hhv(h,n);
m:=barslast(holding=-1)+1;
ll:=llv(l,m);
if c>=sx and a=0 then begin
  if holding=0 then buy(1,1,market);
  a:=1;
end
if c<=xx and a=0 then begin
  if holding=0 then buyshort(1,1,market);
  a:=1;
end
yingkui:=exitprice-enterprice;
cound1:=(holding=-1 and (cross(c,enterprice+3) or cross(c,ll+4))) and time<=1400;
cound2:=(holding=1 and (cross(enterprice-3,c) or cross(hh-4,c))) and time<=1400;
if cound1 then begin
  sellshort(1,1,market);
  if yingkui>=0 then ykcs:=ykcs+1,;
  if yingkui<0 then ykcs:=0;
  if holding=0 and ykcs<3 then buy(1,1,market);
end
if cound2 then begin
  if holding=1 then sell(1,1,market);
  if yingkui>=0 then ykcs:=0;
  if yingkui<0 then ykcs:=ykcs+1;
  if holding=0 and ykcs<3 then buyshort(1,1,market);
end
if (holding=1 and cross(c,enterprice+10)) or time>=1458 then sell(1,1,market);
if (holding=-1 and cross(enterprice-10,c)) or time>=1458 then sellshort(1,1,market);


 回到顶部
帅哥哟,离线,有人找我吗?
漫步金字塔
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
  发帖心情 Post By:2012/9/18 17:41:39 [显示全部帖子]

if holding<0 and c-enterprice>=b*mindiff then begin
sellshort(holding<0,0,market);

buy(holding=0,1,market);

是不是也应该改为

if holding<0 and c-enterprice>=b*mindiff then begin
sellshort(holding<0,0,market);
buy(holding=0,1,market);
hh=h;

if h>hh then hh:=h;

还有,老师

if numlosstrade>=3 and holding>0 then sell(holding>0,0,market);//多头连亏三次后平仓不反手,下为空头

if numlosstrade>=3 and holding<0 then sellshort(holding<0,0,market);

numlosstrade是到现在为止亏损次数,会不会还加上昨天的呢?老师我说的是连续亏损啊!!!

 

if holding>0 and enterprice-c>=b*mindiff then begin
sell(holding>0,0,market);
buyshort(holding=0,1,market);
end//多头止损反手

if holding<0 and c-enterprice>=b*mindiff then begin
sellshort(holding<0,0,market);
buy(holding=0,1,market);
end//空头止损反手

老师,这句是不是三次亏损后要开仓,但是到后面有马上平仓呢???老师辛苦了,恳请仔细解答!

 


 回到顶部
帅哥哟,离线,有人找我吗?
漫步金字塔
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
  发帖心情 Post By:2012/9/19 16:50:57 [显示全部帖子]

您的IP(221.3.133.230)被系统限制,或者您可以和管理员联系。 

这个是怎么回事?老师,能解除限制吗???

 回到顶部
帅哥哟,离线,有人找我吗?
漫步金字塔
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:129 积分:559 威望:0 精华:0 注册:2012/8/28 13:09:08
  发帖心情 Post By:2012/9/20 16:52:39 [显示全部帖子]

variable:a=0,;
input:kl(20);
oo:=valuewhen(time=0901,open);
if time=901 then a=0; 
sx:=oo+kl;
xx:=oo-kl;
if c>=sx and a=0 then begin
  buy(1,1,market);
  a:=1;
end
if c<=xx and a=0 then begin
  buyshort(1,1,market);
  a:=1;
end
if time>=1458 then begin
  sell(1,1,market);
  sellshort(1,1,market)
end

 

老师,模型开盘走出20个点买入或卖出,怎么今天没有信号呢?

 


 回到顶部
总数 18 1 2 下一页