新人小白,自定义指标 iCustom 编写ea遇到问题请教各位前辈

 

根据自定义指标提供的 iCustom buffers想写成ea,现在遇到问题了。

指标名称:test_abc

指标提供的iCustom buffers:

Buffer_7=Buy_Signal, Buffer_8=Sell_signal, Buffer_9= SL_Price, Buffer_10= TP1_Price, Buffer_11= TP2_Price, Buffer_12= TP3_Price.

int OnInit()
  {
   MY_handle=iCustom(NULL,0,"test_abc");
   
   if(MY_handle==INVALID_HANDLE)
     {
      PrintFormat("Failed to generate My_Indicator handle. Error code %d",
                  GetLastError());
      return (INIT_FAILED);
     }
    return(INIT_SUCCEEDED);
   }
void OnTick()
  {
   
   double buffer_7[],buffer_8[],buffer_9[],buffer_10[],buffer_11[],buffer_12[];  
   CopyBuffer(MY_handle,7,0,1,buffer_7);
   CopyBuffer(MY_handle,8,0,1,buffer_8);
   CopyBuffer(MY_handle,9,0,1,buffer_9);
   CopyBuffer(MY_handle,10,0,1,buffer_10);
   CopyBuffer(MY_handle,11,0,1,buffer_11);
   CopyBuffer(MY_handle,12,0,1,buffer_12);

   printf(buffer_7[0]);
   printf(buffer_8[0]);
   printf(buffer_9[0]);
   printf(buffer_10[0]);
   printf(buffer_11[0]);
   printf(buffer_12[0]);
   
  }

输出的值是 1.797693134862316e+308 这种。

请问是哪里有问题,请教!
 

 
alasijiagogogo:

根据自定义指标提供的 iCustom buffers想写成ea,现在遇到问题了。

指标名称:test_abc

指标提供的iCustom buffers:

Buffer_7=Buy_Signal, Buffer_8=Sell_signal, Buffer_9= SL_Price, Buffer_10= TP1_Price, Buffer_11= TP2_Price, Buffer_12= TP3_Price.

输出的值是 1.797693134862316e+308 这种。

请问是哪里有问题,请教!
 

倒叙下数组 就可以了

ArraySetAsSeries

ArraySetAsSeries(buffer_7 , true);