Rss & SiteMap

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

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

标题:[求助]老师请问下这个问题在哪?

1楼
xhqvv 发表于:2015/10/13 14:34:31
MID :=  MA(ref(CLOSE,1),26);
UPPER:= MID + 2*STD(ref(CLOSE,1),26);
LOWER:= MID - 2*STD(ref(CLOSE,1),26);
lc:=ref(CLOSE,1);
high1:=ref(high,1);
low1:=ref(low,1);
   if holding=0 then BEGIN 
  
      if lc>UPPER then
 sell(holding>0,0,LIMITr,open); 
 BUYSHORT(holding=0,1,limitr,open);
 if lc<LOWER then
 sellshort(holding<0,0,LIMITR,open);
 buy(holding=0,1,LIMITR,open);
   end

 if (enterbars=1) then begin
highafterentry:=enterprice;
lowafterentry:=enterprice;
end  else if (enterbars>1) then begin
highafterentry:=max(highafterentry,high1);
lowafterentry:=min(lowafterentry,low1);
    end
    
    if (holding>0 and enterbars>0 ) Then Begin 
     stopline:=enterprice*0.98;
         if max(h,highafterentry)-enterprice>0.02*open  then
 stopline:=enterprice+0.02*open;     
 if h>stopline then
 sell(holding>0,0,LIMITr,stopline);      
end
if (holding<0 and enterbars>0 ) Then  Begin 
 stopline:=enterprice*1.02;
 if enterprice-min(l,lowafterentry)>0.02*open  then 
 stopline:=enterprice-0.02*open;  
 
 if l<stopline then
 sellshort(holding<0,0,LIMITR,stopline);  
end

老师请问下 这个代码 哪里有问题 就是价格高于 boll上轨做空  低于下轨最多 
   然后最大亏损2%  如果触发最大盈利2% 就主动止盈
2楼
xhqvv 发表于:2015/10/13 14:37:21
老师请问下 这个代码 哪里有问题 就是价格高于 boll上轨做空  低于下轨做多 
   然后最大亏损2%  如果触发最大盈利2% 就主动止盈  
  麻烦老师指导下 要怎么写 改进
3楼
jinzhe 发表于:2015/10/13 14:47:38
固定止盈止损的,可以参考软件自带的范例
图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看
4楼
xhqvv 发表于:2015/10/13 16:46:54
D为什么是 专用特色指标 ?
5楼
jinzhe 发表于:2015/10/13 16:49:21
你那里没有吗?
6楼
xhqvv 发表于:2015/10/13 16:58:46
嗯 没有这个模块!
7楼
xhqvv 发表于:2015/10/13 17:06:33
找了一台电脑重装 但是 范例里面 用了 if   c-avgenterprice>50*mindiff  then begin
    sell(1,holding,market);
  但是这样的止盈 测试下来 用了次周期开盘价 实际我是需要 当K线触发止盈 这样的话需要怎么写 ?
8楼
jinzhe 发表于:2015/10/13 17:27:02
这样写是对的,market只表示价格不表示下时间,你要即时触发,在图表交易里面设置为固定轮询模式,轮询间隔1秒
共8 条记录, 每页显示 10 条, 页签: [1]


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