以文本方式查看主题
- 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp)
-- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4)
---- 开空 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=68778)
|
-- 作者:pxmygl
-- 发布时间:2014/8/15 9:22:35
-- 开空
现K低于A-8点, 且前4K中有1K低于A-8点, 开空
A:= hhv(h, todaybar);
if ref(L,1)<(A-8) or ref(L,2)<(A-8) or ref(L,3)<(A-8) or ref(L,4)<(A-8) and L<=a-8 then begin
buyshort(holding=0,1,market);
end
对不对?
其它方法?
|
-- 作者:jinzhe
-- 发布时间:2014/8/15 9:32:22
--
A:= hhv(h, todaybar);
if l<a-8 and ref(any(l<a-8,4),1) then begin
buyshort(holding=0,1,market);
end
|
-- 作者:pyd
-- 发布时间:2014/8/15 9:32:54
--
A:= hhv(h, todaybar); if l<=a-8 and ref(llv(l,4),1)<a-8 then buyshort(holding=0,1,market);
[此贴子已经被作者于2014/8/15 9:33:20编辑过]
|
-- 作者:pxmygl
-- 发布时间:2014/8/15 9:36:52
--
if l<a-8 and ref(any(l<a-8,4),1) then begin
要求:4为不确定值,可能为3或2或1或0 | ??
|
-- 作者:jinzhe
-- 发布时间:2014/8/15 9:39:01
--
用any你再想想看对不对
|
-- 作者:pxmygl
-- 发布时间:2014/8/15 10:11:14
--
此主题相关图片如下:1.jpg
此主题相关图片如下:2.jpg
|
-- 作者:pxmygl
-- 发布时间:2014/8/15 10:12:38
--
我要的是第二种
any会有第一种
|
-- 作者:jinzhe
-- 发布时间:2014/8/15 10:17:16
--
那你写的也不对,你写的和我一个意思,只不过我是简化了的
要写成
ref(l,1)<a-8 and not(ref(l,2)<a-8) and not(ref(l,3)<a-8) and not(ref(l,4)<a-8) or
ref(l,2)<a-8 and not(ref(l,1)<a-8) and not(ref(l,3)<a-8) and not(ref(l,4)<a-8) or
ref(l,3)<a-8 and not(ref(l,1)<a-8) and not(ref(l,2)<a-8) and not(ref(l,4)<a-8) or
ref(l,4)<a-8 and not(ref(l,1)<a-8) and not(ref(l,2)<a-8) and not(ref(l,3)<a-8)
前4只有一个 条件成立
|
-- 作者:pxmygl
-- 发布时间:2014/8/15 10:21:56
--
不能简化?
|
-- 作者:jinzhe
-- 发布时间:2014/8/15 10:31:03
--
sumbars(l<a-8,1)<=4看看这个咋样
|