Your topic has been moved to the section: Technical Indicators — In the future, please consider which section is most appropriate for your query.
Please clarify how you code to access buffer values.
Yashar Seyyedin #: Please clarify how you code to access buffer values.
Hello Yashar, thanks for your reply. Below is the code I used to call the "MA_Of_CCI" indicator. Kindly verify to see if am doing something wrong ...
//+------------------------------------------------------------------+ //| CC_Call.mq5 | //| Fxheadmaster | //| | //+------------------------------------------------------------------+ #property copyright "Fxheadmaster" #property link "Tsoene" #property version "1.00" // input int CCI_period = 21; input ENUM_APPLIED_PRICE Applied_Price = PRICE_CLOSE; input int CCI_MA_period = 21; input ENUM_MA_METHOD MA_type = MODE_SMA; // int CC_Handle; double CCI_Val,MA_Val; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- CC_Handle=iCustom(Symbol(),PERIOD_CURRENT,"Examples\\MA_OF_CCI",CCI_period,CCI_MA_period,MA_type,Applied_Price); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- Comment(""); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- if(IsNewCandle()) { CCI_Val=CC1(0,1); //buffer 0 MA_Val =CC1(1,1); //buffer 1 //--------- Comment( "CCCI Val ",DoubleToString(CCI_Val,Digits()) +"\nMA Val ",DoubleToString(MA_Val,Digits()) ); } //cand funct end } //+-----------------------------end----------------------------------+ bool IsNewCandle() { static int ChartBars=0; int BarsOnChart = iBars(_Symbol,PERIOD_CURRENT); // if(ChartBars==BarsOnChart) { return(false); } // ChartBars=BarsOnChart; return(true); } //-----------------------------------------------------------------/ double CC1(int buff,int shift) { double arr[]; ArraySetAsSeries(arr,true); CopyBuffer(CC_Handle,buff,0,Bars(_Symbol,0),arr); // return(arr[shift]); } //-----------------------------------------------------------------/
Hello community, can someone please look at my issue and assist me?

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The mt5 indicator below (MA_Of_CCI) appears to have two buffers but when used for an EA code, these buffers do not return any values. They are empty almost all time during test and this is the problem.
Please take a look at the Code below and assist; thanks!