Rss & SiteMap

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

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

标题:[求助]公式出现问题

1楼
beldon 发表于:2015/9/17 13:33:12
buy(holding<=0 and high>ref(ref(high,1),1,limitr,max(0,ref(high,1)));

这句代码哪里有问题呢,提示如下:
编译错误:
引用的括号不完整。
2楼
jinzhe 发表于:2015/9/17 13:40:17

high>ref(high,1)

你多在外面多加了一个ref,去掉就行

3楼
beldon 发表于:2015/9/17 13:49:39
老师,测试时提示,某个资金已经不足,后续的周期已经无法开仓,是什么原因啊
4楼
jinzhe 发表于:2015/9/17 13:51:32

1.亏剩下的钱不够开仓

2.开仓太多剩下的钱不够开仓

5楼
beldon 发表于:2015/9/17 14:12:22
老师,您看看这个公式怎么优化能避免这个问题发生呢
sell(holding>0 and low<=ref(low,1) and enterbars>0,0,limitr,min(0,ref(low,1)));
sellshort(holding<0 and high>=ref(high,1) and enterbars>0,0,limitr,max(0,ref(high,1)));

buyshort(holding>=0 and low<ref(low,1),1,limitr,min(0,ref(low,1)));
buy(holding<=0 and high>ref(high,1),1,limitr,max(0,ref(high,1)));
6楼
jinzhe 发表于:2015/9/17 14:15:52

开仓语句里面的持仓判断都写成holding=0

7楼
beldon 发表于:2015/9/17 15:18:44
老师持仓更改后,还是出现以上的情况
8楼
jinzhe 发表于:2015/9/17 15:22:32

不会,

1手买卖如果还出现不够

那么就是你设定的钱太少不够开1手

共8 条记录, 每页显示 10 条, 页签: [1]


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