iCustom problem - empty value (2147483647)

 

Hello,

I'm trying to get value from iCustom (export data to csv file) and I'm getting "2147483647" all the time.

Here is my code:

iCustom(NULL,0,"StrengthMeter_wSuffix-mod2","EUR,USD,GBP,JPY,CHF,CAD,AUD,NZD","1,1,1,1,1,1,1,1",ture,"","","EURUSD,EURCHF,EURJPY,GBPUSD,USDCHF,GBPJPY,GBPCHF,AUDUSD",0,60,10,true,ture,false,false,false,30,200,20,20,Green,Red,Aqua,Green,Red,White,Yellow,White,Purple,Orange,Teal,White,0,i)

Indicator's input:

extern string   Currencies              = "EUR,USD,GBP,JPY,CHF,CAD,AUD,NZD";
extern string   CurrDisplay             = "1,1,1,1,1,1,1,1";
//extern string SymbolFixes             ="";                                                                    //for irregular Symbols
extern bool    AutoSuffixAdjust  = true; //try to get symbol suffix automatically, fxdaytrader
extern string   SymbolSuffixes          ="";                                                                    //for irregular Symbols
extern string   SymbolPrefixes          ="";                                                                    //for irregular Symbols
extern string   ShowSignal              = "EURUSD,EURCHF,EURJPY,GBPUSD,USDCHF,GBPJPY,GBPCHF,AUDUSD";
extern int              TimeFrame               = 0;
extern int              StrengthBase    = 60;
extern int              RecentCHBase    = 10;
extern bool             ShowLineChart   = true;
extern bool             ShowBarChart    = true;
extern bool             UpdateOnTick    = false;
extern bool             AllowAlert              = false;
extern bool             AllowSound              = false;
extern int              MinAlertIntv    = 30;
extern int              LineChartBars   = 200;
extern int              LegendOffestY   = 20;
extern int              MeterPosition   = 20;
extern color    BullColor               = Green;
extern color    BearColor               = Red;
extern color    Color0                  = Aqua;
extern color    Color1                  = Green;
extern color    Color2                  = Red;
extern color    Color3                  = White;
extern color    Color4                  = Yellow;
extern color    Color5                  = Purple;
extern color    Color6                  = Orange;
extern color    Color7                  = Teal;
extern color    TextColor               = White;

The indicator has 8 buffers - what I am doing wrong?

Thanks for answers.

 
Adam Perkowski: The indicator has 8 buffers - what I am doing wrong?
  1. iCustom Indicator
    iCustom(NULL,0,"StrengthMeter_wSuffix-mod2",
    "EUR,…,NZD",
    "1,1,1,1,1,1,1,1",
    // ""
    ture,
    "",
    "",
    "EURUSD,…,AUDUSD",
    0,
    60,
    10,
    true,
    ture,
    false,
    false,
    false,
    30,
    200,
    20,
    20,
    Green,
    Red,
    Aqua,
    Green,
    Red,
    White,
    Yellow,
    White,                                    
    Purple,
    Orange,
    Teal,
    White,
    0,i)
    //
    extern string   Currencies              = "EUR,…,NZD";
    extern string   CurrDisplay             = "1,1,…,1";
    //extern string SymbolFixes             ="";
    extern bool    AutoSuffixAdjust  = true; //try to get symbol …
    extern string   SymbolSuffixes          ="";
    extern string   SymbolPrefixes          ="";
    extern string   ShowSignal              = "EURUSD,…,AUDUSD";
    extern int              TimeFrame       = 0;
    extern int              StrengthBase    = 60;
    extern int              RecentCHBase    = 10;
    extern bool             ShowLineChart   = true;
    extern bool             ShowBarChart    = true;
    extern bool             UpdateOnTick    = false;
    extern bool             AllowAlert      = false;
    extern bool             AllowSound      = false;
    extern int              MinAlertIntv    = 30;
    extern int              LineChartBars   = 200;
    extern int              LegendOffestY   = 20;
    extern int              MeterPosition   = 20;
    extern color    BullColor               = Green;
    extern color    BearColor               = Red;
    extern color    Color0                  = Aqua;
    extern color    Color1                  = Green;
    extern color    Color2                  = Red;
    extern color    Color3                  = White;
    extern color    Color4                  = Yellow;
                                            
    extern color    Color5                  = Purple;
    extern color    Color6                  = Orange;
    extern color    Color7                  = Teal;
    extern color    TextColor               = White;
    
    
  2. Since you are passing all parameters unchanged you can just leave all of them out.

 
William Roeder:
  1. iCustom Indicator
  2. Since you are passing all parameters unchanged you can just leave all of them out.

Thanks for reply.

I tried and it's still the same, also checked:

iCustom(NULL,0,"StrengthMeter_wSuffix-mod2",0,i)

without reasult (value 2147483647).

Is it possible that this type of indicator cannot be called via iCustom?

 
Adam Perkowski:

Thanks for reply.

I tried and it's still the same, also checked:

without reasult (value 2147483647).

Is it possible that this type of indicator cannot be called via iCustom?

Check your externs :

iCustom(NULL,0,"StrengthMeter_wSuffix-mod2",
               "EUR,USD,GBP,JPY,CHF,CAD,AUD,NZD",
               "1,1,1,1,1,1,1,1",
               ture,
               "","","EURUSD,EURCHF,EURJPY,GBPUSD,USDCHF,GBPJPY,GBPCHF,AUDUSD",
                0,60,10,true,ture,false,false,false,30,200,20,20,
              Green,Red,Aqua,Green,Red,White,Yellow,White,Purple,Orange,Teal,White,0,i)
Documentation on MQL5: Common Functions / GetTickCount64
Documentation on MQL5: Common Functions / GetTickCount64
  • www.mql5.com
GetTickCount64 - Common Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
What is the value of "i" when you call the iCustom? You can check the value of the "0" buffer in the Data Window.
 
ffoorr:

Check your externs :

Thanks for reply.

I corrected for "true" and this is the same.

What about GetTickCount64? I am not a programer and I don't know exacly what you mean.

 
Laszlo Tormasi:
What is the value of "i" when you call the iCustom? You can check the value of the "0" buffer in the Data Window.

Using indicator on MT4 it works correctly. I can see values every 8 buffers in the Data Windows. 0 is for EUR.

I want to create csv file with values from this indicator and "i" is for loop "for". Others indicators works fine.

//+------------------------------------------------------------------+
//|                                             Indicator_to_CSV.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Inovance"
#property link      "https://www.inovancetech.com/"
#property description "Save indicator values and OHLC data to a csv file."
#property version   "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
//#property indicator_color2 Blue

   //Indicator periods
input int CCIPeriod = 14;
input int RSIPeriod = 14;

   //Filename
input string   FileName = "CCIRSIdata.csv";


   //Indicator Buffers
//double CCIBuffer[];
//double RSIBuffer[];
//double SM[];
double CFP[];
//+------------------------------------------------------------------+
//| Initialization function                                          |
//+------------------------------------------------------------------+
int OnInit()
  {
      //Indicator buffers mapping
   //SetIndexBuffer(0,CCIBuffer);
   //SetIndexBuffer(1,RSIBuffer);
   //SetIndexBuffer(0,SM);
   SetIndexBuffer(0,CFP);   
      //Indicator styling
   SetIndexStyle(0,DRAW_LINE);
  // SetIndexStyle(1,DRAW_LINE);
   //SetIndexStyle(2,DRAW_LINE);
   //SetIndexStyle(3,DRAW_LINE);   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
      //Define variables
      int limit,i;
      int counted_bars = IndicatorCounted();
      
      //Make sure on most recent bar
      if(counted_bars>0) counted_bars--;
   
      //Set limit
 //     limit = Bars - counted_bars - 1;
      limit = 200;      
      
      //Main loop
      for(i = limit - 1; i>=0; i--) 
         { 
         
            //Indicators
            //CCIBuffer[i] = iCCI(NULL,0,CCIPeriod,PRICE_OPEN,i);
           // RSIBuffer[i] = iRSI(NULL,0,RSIPeriod,PRICE_OPEN,i); 
                        
            //CFP[i] = iCustom(NULL,0,"CFP_v2",0,i);
            CFP[i] = iCustom(NULL,0,"StrengthMeter_wSuffix-mod2",
               "EUR,USD,GBP,JPY,CHF,CAD,AUD,NZD",
               "1,1,1,1,1,1,1,1",
               true,
               "","","EURUSD,EURCHF,EURJPY,GBPUSD,USDCHF,GBPJPY,GBPCHF,AUDUSD",
                0,60,10,true,true,false,false,false,30,200,20,20,
              Green,Red,Aqua,Green,Red,White,Yellow,White,Purple,Orange,Teal,White,0,i);
            //Create and Open file
            int handle=FileOpen(FileName,FILE_CSV|FILE_READ|FILE_WRITE,",");
            
            //Name column headers
            FileWrite(handle,"Open Timestamp","Open","High","Low","Close","Volume","CCI(14)","RSI(14)","CCF","MA40");
            
            //Go to end of file
            FileSeek(handle,0,SEEK_END);
            
            //Record Indicator values
            FileWrite(handle,Time[i],CFP[i]);
            
            //Close file
            FileClose(handle);    
            
         }
         
      return(0);
  }