以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  不知道为什没有信号。 请看下  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=9334)

--  作者:tonybig
--  发布时间:2011/12/12 16:52:42
--  不知道为什没有信号。 请看下

runmode:0;

input:riskratio(1,0,2,1);
input:atrlength(20,5,30,5);
input:entryperiod(20,5,60,5);
input:exitperiod(10,5,60,5);
input:n(10,5,30,5);
variable:times=0;

atr:=ref(ma(tr,atrlength),1);
marginratio:=10/100;

entryupperband:=ref(hhv(high,entryperiod),1);//上轨
entrylowerband:=ref(llv(low,entryperiod),1);//下轨

exitupperband:=ref(hhv(high,exitperiod),1);//空头止损上轨
exitlowerband:=ref(llv(low,exitperiod),1);//多头止损下轨

entrylongcond:=high>=entryupperband;//最高价突破上轨开多
entryshortcond:=low<=entrylowerband;//最低价突破下轨开空

exitlongcond:=low<=exitlowerband;// 最低价突破多头止损下轨  止损
exitshortcond:=high>=exitupperband;// 最高价突破空头止损上轨  止损

if entrylongcond then buy(holding=0,1,limitr,entryupperband);


 
if entryshortcond then buyshort(holding=0,1,limitr,entrylowerband);
 


if exitlongcond then sell(holding>0,1,exitlowerband);
 
if exitshortcond then sellshort(holding<0,1,exitupperband);

 

不知道为什没有信号。   请看下


 


--  作者:26327756l
--  发布时间:2011/12/12 17:03:35
--  

下单的价格问题

 

是未成交标志,交易系统测试时,对于价格在当日高低价之外的模拟委托价格视为无效委托而为白色箭头标记(例如海龟交易算法不断的发出止损指令),用户可以在选项->视图->将“显示未成交标志”钩选去掉。


--  作者:fly
--  发布时间:2011/12/13 10:09:14
--  

(1)开平仓函数力量参数写的有问题,具体参考开平仓函数-----这个问题,您一开始发帖就在纠正,纠正到现在还是错的.

 

(2)委托价格,如果一开始您不会写,就不要用上轨或者下轨,

    最简单的,直接用BUY(CON,1,THISCLOSE)类似格式;

    其次,用buy(CON, 1, limit, c+2*mindiff)类似格式;

    最后,如果非想用一个您指定的价格,要把该价格变成一个最小变动价位的整数倍,才能以委托价格的形式发送出去.这个以前您发的帖子中有回复的.如果用的不顺手,就注意图表调试,具体可参考http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=1246&page=1&star=1


 

 


--  作者:scc
--  发布时间:2011/12/15 20:01:56
--  
不懂