以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  老师好,帮忙编个程序  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=56481)

--  作者:yhl99414
--  发布时间:2013/9/10 23:38:56
--  老师好,帮忙编个程序

突破首根k线最高点开多仓3手,突破首根k线最低点开空仓3手。

止盈:1/3止盈33点,止盈后剩下2手设回调止损10点(实质盈利10点);

       1/3止盈44点,止盈后剩下1/3设回调一半止损,或者到收盘平仓。

 


--  作者:jinzhe
--  发布时间:2013/9/11 8:41:13
--  

首根k线 指的是当日的第一根k线?

1/3止盈33点的意思是盈利33点后平掉1/3手持仓?


--  作者:90也玩期货
--  发布时间:2013/9/11 9:24:37
--  
老师:是的
--  作者:90也玩期货
--  发布时间:2013/9/11 9:24:51
--  
不知道这个怎么写,谢谢老师
--  作者:90也玩期货
--  发布时间:2013/9/11 9:42:36
--  
老师可以回答我吗


--  作者:jinzhe
--  发布时间:2013/9/11 9:44:09
--  

variable:hh=0;
variable:ll=100000;
n:=3;
h_1:valuewhen(todaybar=1,high);
l_1:valuewhen(todaybar=1,low);

if h>h_1 then begin
 buy(holding=0,3,thisclose);
 hh:=h;
end

if h>hh then hh:=h;

if l<l_1 then begin
 buyshort(holding=0,3,thisclose);
 ll:=l;
end

if l<ll then ll:=l;

if c-enterprice>33*mindiff then sell(holding>0,n/3,thisclose);

if enterprice-c>33*mindiff then sellshort(holding<0,n/3,thisclose);

if hh-h>10*mindiff and close-enterprice>10*mindiff then sell(holding>0,n*2/3,thisclose);

if l-ll>10*mindiff and enterprice-close>10*mindiff then sellshort(holding<0,n*2/3,thisclose);

if time=closetime(0) then begin
 sellshort(1,0,thisclose);
 sell(1,0,thisclose);
end


--  作者:90也玩期货
--  发布时间:2013/9/11 10:14:40
--  
谢谢老师,辛苦了
--  作者:yhl99414
--  发布时间:2013/9/11 14:51:41
--  
90后干嘛来凑热闹?
--  作者:jinzhe
--  发布时间:2013/9/11 14:55:32
--  
图片点击可在新窗口打开查看新一代啊这是,未来的主力
--  作者:yhl99414
--  发布时间:2013/9/11 17:36:49
--  
老师,针对白银的话,这里有个问题啊就是白银按照21点开始算第一条k线的,能不能把白天的9点开始第一条k线算首根k线??谢谢老师