Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共7 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:老师好

1楼
诗与远方 发表于:2021/2/25 9:48:23
请问:这个怎样写?开仓是走完K线,强平不用走完k线。
        
        价格跌破30均线,多单全部强平。
        价格突破30均线,空单全部强平。
2楼
FireScript 发表于:2021/2/25 9:58:19

平仓语句倒是简单。
ma30:ma(c,30);
sell(cross(ma30,c),holding,market);
sellshort(cross(c,ma30),holding,market);


重点是这个
走完K线与固定轮训模式共存:http://www.weistock.com/bbs/dispbbs.asp?boardid=10&Id=151891
所以你需要额外处理下开仓的条件。从原先的条件A,变成ref(a,1)就行了。
3楼
诗与远方 发表于:2021/2/25 10:26:16

这个不能通过测评??
marketr   交易系统函数的第三参数必须为交易控制符

if [c<hh-20*mindiff and holding>0 then sell(1,holding,marketr)]or [sell(cross(ma180,h),holding,market)];
if [c>ll+20*mindiff and holding<0 then sellshort(1,holding,marketr)]or[ sellshort(cross(h,ma180),holding,market)];
4楼
FireScript 发表于:2021/2/25 10:30:21
[]括号是不能使用的。
然后你这里用or是干嘛的

if [c<hh-20*mindiff and holding>0 then sell(1,holding,marketr)]or [sell(cross(ma180,h),holding,market)];

你不能把平仓语句用or连接啊。这即不规范,也没有实际效果。
5楼
FireScript 发表于:2021/2/25 10:37:21
 你要这样一句句分开写。
if c<hh-20*mindiff and holding>0 then sell(1,holding,marketr);

或者这样把条件合并在一起
if (c<hh-20*mindiff and holding>0) or (cross(ma180,h)) then sell(1,holding,marketr);
6楼
诗与远方 发表于:2021/2/25 10:37:33
 只要两个平仓条件,其中一个成立,就达到平仓效果


[c<hh-20*mindiff and holding>0 then sell(1,holding,marketr)]这是移动止损   or 这是或者的意思          [sell(cross(ma180,h),holding,market)]这是强平;
7楼
FireScript 发表于:2021/2/25 10:38:26
 参考5楼的回复。我知道你的意思,但是你原先的写法是不规范的。要么分开写,要么在条件的地方使用or连接。
共7 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.