arp 发表于 2011-9-8 21:18:52

求牛版主帮忙

下面的图形中,后面的八个向上箭头只有最后一个才是正确的,它前面的七个全是由K 线上去后又下来的假信号留下的垃圾,变换一下周期再变回来,那七个就没了;求你解决的问题是:能否让图表自动刷新,使它只有一个箭头,条件变化之后,让不符合条件的箭头自动消失?
谢谢了!!!
[*]
[*]#property indicator_chart_window
[*]#property indicator_buffers 8
[*]#property indicator_color1 Gold
[*]#property indicator_color2 Lime
[*]#property indicator_color3 Lime
[*]#property indicator_color4 Gold
[*]
[*]extern int 均线周期2 = 2;
[*]extern int 均线周期5 = 5;
[*]extern int 类型1 = 0;//0-SMA; 1-EMA; 2-SMMA; 3-LWMA
[*]extern int 类型2 = 0;//0-SMA; 1-EMA; 2-SMMA; 3-LWMA
[*]double ibuf_1[];
[*]double ibuf_2[];
[*]double ibuf_3[];
[*]double ibuf_4[];
[*]int gi_1;
[*]int gi_2 = 0;
[*]datetime time_1;
[*]//+------------------------------------------------------------------+
[*]int init() {
[*]   IndicatorBuffers(8);
[*]   SetIndexStyle(0, DRAW_LINE,0,2);
[*]   SetIndexStyle(1, DRAW_LINE,0,2);
[*]   SetIndexStyle(2, DRAW_ARROW,0,1);
[*]   SetIndexStyle(3, DRAW_ARROW,0,1);
[*]   SetIndexArrow(2, 233);
[*]   SetIndexArrow(3, 234);
[*]   SetIndexBuffer(0, ibuf_1);
[*]   SetIndexBuffer(1, ibuf_2);
[*]   SetIndexBuffer(2, ibuf_3);
[*]   SetIndexBuffer(3, ibuf_4);
[*]   gi_1 = 0;
[*]   return (0);
[*]}
[*]//+------------------------------------------------------------------+
[*]//| Custom indicator deinitialization function                     |
[*]//+------------------------------------------------------------------+
[*]int deinit() {
[*]   return(0); }
[*]//+------------------------------------------------------------------+
[*]int start() {
[*]   int counted_bars = IndicatorCounted();
[*]   if (counted_bars < 0) return (-1);
[*]   if (counted_bars > 0) counted_bars--;
[*]   int limit = Bars - counted_bars;
[*]   for (int i = limit; i >= 0; i--) {
[*]      ibuf_1 = iMA(NULL, 0, 均线周期2, 0, 类型1, PRICE_CLOSE, i);
[*]      ibuf_2 = iMA(NULL, 0, 均线周期5, 0, 类型2, PRICE_CLOSE, i);
[*]//+----
[*]      if (ibuf_1 < ibuf_2 && ibuf_1 > ibuf_2) {
[*]         ibuf_3 = Low - 5 * Point;
[*]      }
[*]//+----
[*]      if (ibuf_1 > ibuf_2 && ibuf_1 < ibuf_2) {
[*]         ibuf_4 = High + 5 * Point;
[*]      } else gi_2 = FALSE;
[*]   }
[*]   return (0);}

复制代码

落羽 发表于 2012-11-25 16:59:05

牛牛牛牛

走就走吧 发表于 2012-11-25 16:59:05

这个站不错!!

pkvszl 发表于 2012-11-25 18:07:25

帮顶

妖怪 发表于 2012-11-25 18:07:25

人气还要再提高

CCN客户经理 发表于 2012-11-25 18:07:25

我十目一行也还是看不懂啊

newer 发表于 2012-11-25 18:07:25

呵呵 哪天得看看 `~~~~

痔疮犯了 发表于 2012-11-25 18:07:25

长时间没来看了 ~~

心魔 发表于 2012-11-25 18:07:25

回复一下

jzjjtthte 发表于 2012-11-25 18:07:25

你好!我想编写一平仓条件,可一直不成功。当下单成功后赢利超过7点之后赢利又小于6点平仓。就这个平仓条件能辛苦帮我写一下吗?这样能保住赢利不会变亏损。先行谢谢了!!!~~~
页: [1] 2
查看完整版本: 求牛版主帮忙