以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  怎么输出棒状的线啊?  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=169454)

--  作者:m1978xz
--  发布时间:2019/4/19 13:51:35
--  怎么输出棒状的线啊?
代码在下边,已经通过编译,就最后一句写不好。
目前输出是这样的包络线:

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20190419134904.png
图片点击可在新窗口打开查看
我想输出这样的棒状线:

图片点击可在新窗口打开查看此主题相关图片如下:222.png
图片点击可在新窗口打开查看
请问该怎么改 啊?





s_czsc_high:ref(H,1);//前一K线处理完包含关系之后的高,初值暂定为前K高
s_czsc_low:ref(L,1);//前一K线处理完包含关系之后的低,初值暂定为前K低
s_direction:0;
s_status:0;
        //包含
czsc_high:=0;//当前K线高点,初值暂定为前K高
czsc_low:=0;   //当前K线低点,初值暂定为前K低
        //分型
direction:=0;        //当前K线方向
status:=0;
        //分型
direction:=0;        //当前K线方向
status:=0;
f1:=(s_czsc_high>0 or s_czsc_low>0);
f2:=((s_czsc_high>High and s_czsc_low<Low) or (High>s_czsc_high and Low<s_czsc_low));
f3:=(s_direction>0);
f4:=(s_direction<0);
f5:=(s_direction>0);
f6:=(High<s_czsc_high);
f7:=(s_direction<0);
f8:=(Low>s_czsc_low);
f9:=((High>High[1] and Low<Low[1]) or (High[1]>High and Low[1]<Low));
f10:=(High[1]>High[2]);
f11:=(High[2]>High[1]);
f12:=(High[2]<High[1]);
f13:=(High[1]>High);
f14:=(Low[2]>Low[1]);
f15:=(Low[1]<Low);

                   //当前K线状态(0.表示延续方向 1.表示K线转变方向) 
///---------------第一组判断开始     
        If f1=1 and f2=1 and f3=1 then begin  //如果前高大于零或者前低大于零  IF1                                                                                                                                   //存在缠中说禅K线的
               
                               direction=1; 
                                status=0;
                                czsc_high=Max(s_czsc_high,High); 
                                czsc_low=Max(s_czsc_low,Low);   
                         end //对应IF3
 //更新最高点和最低点
                        If f1=1 and f2=1 and f3=0 and f4=1 then begin
                                direction=-1; 
                                status=0;
                                czsc_high=Min(s_czsc_high,High); 
                                czsc_low=Min(s_czsc_low,Low);
                           end//对应IF4
                      
                        
///---------------第二组判断开始
                 If f1=1 and f2=0 and f5=1 and f6=1 then begin  //如果前高大于零或者前低大于零  IF1                                                                                                                                                                             //不存在包含关系
                                       direction=-1; 
                                        status=1;
                                        czsc_high=High; 
                                        czsc_low=Low;
                 end
                 If f1=1 and f2=0 and f5=0 and f7=1 and f8=1 then begin 
                                        direction=1;
                                        status=1;
                                        czsc_high=High; 
                                        czsc_low=Low;
                  end
                 If f1=1 and f2=0 and f5=0 and f7=1 and f8=0 then begin 
                                direction=-1;
                                status=0;
                                czsc_high=min(s_czsc_high,High); 
                                czsc_low=min(s_czsc_Low,Low);
                  end
///---------------第三组判断开始 
                   If f1=0 and f9=1 and f10=1 then begin 
                                        direction=1; 
                                        status=0;
                                        czsc_high=Max(High[1],High); 
                                        czsc_low=Max(Low[1],Low);
                          end  
                          
                  If f1=0 and f9=1 and f10=0 then begin                                                                                                                                 //判断方向
                                direction=-1; 
                                status=0;
                                czsc_high=Min(High[1],High); 
                                czsc_low=Min(Low[1],Low);
                     end                 
                   
                   If f1=0 and f9=0 and f12=1 and f13=1 then begin 
                                        direction=-1; 
                                        status=1;
                                        czsc_high=High; 
                                        czsc_low=Low;
                    end
                    If f1=0 and f9=0 and f12=1 and f13=0 then begin
                                        direction=1; 
                                        status=0;
                                        czsc_high=Max(High[1],High); 
                                        czsc_low=Max(Low[1],Low);
                     end
                                            //------
                          
                      If f1=0 and f9=0 and f12=0 and f14=1 and f15=1 then begin
                                        direction=1; 
                                        status=1;
                                        czsc_high=High; 
                                        czsc_low=Low;
                       end                           
                      If f1=0 and f9=0 and f12=0 and f14=1 and f15=0 then begin
                                        direction=-1; 
                                        status=0;
                                        czsc_high=Min(High[1],High); 
                                        czsc_low=Min(Low[1],Low);          
end
                drawline(czsc_low>0,czsc_low,czsc_high>0,czsc_high,0),colorstick,colorYellow, linethick1;                                                                                                                      //输出缠中说禅K线
                
          


--  作者:FireScript
--  发布时间:2019/4/19 14:04:58
--  
 这个应该是STICKLINE( , , , , , ) 柱状图函数。你试下看看这个函数。