以文本方式查看主题

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

--  作者:jinzhe
--  发布时间:2015/2/25 17:30:28
--  

http://www.weistock.com/bbs/dispbbs.asp?BoardID=4&ID=75645&skin=0

和你年前发的有什么本质上的区别吗?


--  作者:jinzhe
--  发布时间:2015/2/26 9:13:43
--  
开多条件  D1、D2、D3、D4、D5
多仓止损条件  ZSD
开空条件  K1、K2、K3、K4、K5
空仓止损条件  ZSK
多仓止损条件:开多仓后, 最低价 少于 开多仓当根K线的最低价 并且 收盘价 少于 开多仓当根K线的最低价。   如何编写?
   这个条件可以简化为收盘价 少于 开多仓当根K线的最低价
空仓止损条件:开空仓后, 最高价 大于 开空仓当根K线的最高价 并且 收盘价 大于 开空仓当根K线的最高价。   如何编写?
   这个条件可以简化为收盘价 大于 开空仓当根K线的最高价

 

if d1 or d2 or d3 or d4 or d5 then begin

    sellshort(1,0,thisclose);

    buy(holding=0,1,thisclose);

end

 

if k1 or k2 or k3 or k4 or k5 then begin

     sell(1,0,thisclose);

     buyshort(holding=0,1,thisclose);

end

 

 

if holding>0 and close<ref(low,enterbars) then sell(1,0,thisclose);

if holding<0 and close>ref(h,enterbars) then sellshort(1,0,thisclose);

 

 

 


--  作者:jinzhe
--  发布时间:2015/2/26 9:53:05
--  
写了,开头两段就是
--  作者:jinzhe
--  发布时间:2015/2/26 10:04:23
--  
这两项是止损,之前的两段是开仓以及反手
--  作者:jinzhe
--  发布时间:2015/2/26 10:11:39
--  

你是要止损之后立即反手?


--  作者:jinzhe
--  发布时间:2015/2/26 10:38:05
--  
那就对了,只要把我写的那两句放最前面就能满足了
--  作者:jinzhe
--  发布时间:2015/2/26 11:06:52
--  

if holding>0 and close<ref(low,enterbars) then sell(1,0,thisclose);


if holding<0 and close>ref(h,enterbars) then sellshort(1,0,thisclose);

 

if d1 or d2 or d3 or d4 or d5 then begin

    sellshort(1,0,thisclose);

    buy(holding=0,1,thisclose);

end

 

if k1 or k2 or k3 or k4 or k5 then begin

     sell(1,0,thisclose);

     buyshort(holding=0,1,thisclose);

end


--  作者:jinzhe
--  发布时间:2015/2/26 13:44:09
--  

加了后要干什么?

把你的话详细描述一遍

[此贴子已经被作者于2015/2/26 13:44:20编辑过]

--  作者:jinzhe
--  发布时间:2015/2/26 14:00:15
--  
if holding>0 and close<ref(low,enterbars) then sell(1,0,thisclose);
if holding<0 and close>ref(h,enterbars) then sellshort(1,0,thisclose);
if pd1 or pd2 or pd3 or pd4 then sell(1,0,thisclose);
if pk1 or pk2 or pk3 or pk4 then sellshort(1,0,thisclose);

if d1 or d2 or d3 or d4 or d5  then begin
sellshort(1,0,thisclose);
buy(holding=0,1,thisclose);
end
 
if k1 or k2 or k3 or k4 or k5  then begin
sell(1,0,thisclose);
end

--  作者:jinzhe
--  发布时间:2015/2/27 8:59:00
--  

要加这一句。

我是复制你的代码,而你的代码是漏了这一句

 

[此贴子已经被作者于2015/2/27 8:59:18编辑过]