[警告关闭!]任何新手问题,为了不给论坛添乱。专业人士,不要走过。没有你,哪里都不能去。 - 页 807

 
granit77:
你可能有一个草案或不完整的代码。该指标是硬连接的,代码中没有使用任何外部变量。

我所下载的几乎是全部内容。我只剪出了坐标。
 
Dersu:
我几乎已经下载了所有的东西。我只剪出了坐标。

一些未完成的东西,但它是这样工作的。显示OBV和其平滑线之间的差异。输出了唯一影响的参数(平滑程度),没有其他可以改变的。

//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Silver
//---- indicator parameters
extern int SignalSMA=10;
//---- indicator buffers
double ind_buffer1[];
double ind_buffer2[];
double ind_buffer3[];
double ind_buffer4[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- 2 additional buffers are used for counting.
IndicatorBuffers(4);
//---- drawing settings
SetIndexStyle(0,DRAW_LINE);
SetIndexDrawBegin(0,SignalSMA);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);
//---- 3 indicator buffers mapping
if(!SetIndexBuffer(0,ind_buffer1) &&
!SetIndexBuffer(1,ind_buffer2) &&
!SetIndexBuffer(3,ind_buffer4) &&
!SetIndexBuffer(2,ind_buffer3))
Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
  IndicatorShortName("OBV_M");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Average of Oscillator |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st additional buffer
for(int i=0; i<limit; i++)
ind_buffer2[i]=iOBV(NULL, 0, PRICE_CLOSE, i);
//---- signal line counted in the 2-nd additional buffer
for(i=0; i<limit; i++) {
ind_buffer3[i]=iMAOnArray(ind_buffer2,Bars,SignalSMA,0,MODE_SMA,i);
//ind_buffer4[i]=iMAOnArray(ind_buffer2,Bars,3,0,MODE_SMA,i);
}
//---- main loop
for(i=0; i<limit; i++)
ind_buffer1[i]=ind_buffer2[i]-ind_buffer3[i];
//---- done
return(0);
}
//+------------------------------------------------------------------+
 

谢谢你,granit77。

我把那里的参数("OBV_M")擦掉了,对不起。

我大体上理解这种情况并接受它。

而你的第一条评论澄清了一切,它使我获得了知识,谢谢你。

 
检查了一下--一切正常。
 

日安!

在 "专家 "选项卡中,我得到了这样的信息:"专家被禁用,因为该账户已被更改"。

这是什么原因,有人遇到过这种情况吗?


我决定澄清一下。

我在同一家经纪公司的两个终端都收到了这个信息。

其中一个是模拟账户,另一个是真实账户。

 
当你在终端上改变账户时,默认情况下,EA被阻止。取消勾选 "服务-设置-顾问-更改账户时禁用EA "的方框。
 
收到,但我没有改变账户。
 
这可能是由于安装了同一直流的另一个终端吗?
 
你能告诉我为什么有时当我试图创建一个订单时,会出现130的错误信息。 当然,专家顾问可能试图在接近市场时下单,但为什么会出现130的错误--我如何才能解决这个问题?
 
T-G:
你能告诉我为什么有时当我试图下单时,虽然止损没有问题,但却写着130的错误。 当然,也许专家顾问试图在接近市场时下单,但为什么会出现130的错误--我怎样才能解决这个问题?
你能给我代码吗?他们会发现错误...:)
原因: