include problam

 

hello, I want to use this indicator in my EA but it have these errors:

'[' - open parenthesis expected Indicators.mqh 490 37

'Lips' - pointer to this function type is not supported yet Indicators.mqh 490 33

'[' - array required Indicators.mqh 490 37

'Lips' - function call missing, open parenthesis expected Indicators.mqh 490 33


 
09198866726 mohammadi :


Where is your question? It is not clear what you are asking about. Where is your MQL5 code?

 

here is a class for Alligator indicator and it have this errors in two lines before end:

'[' - open parenthesis expected Indicators.mqh 490 37

'Lips' - pointer to this function type is not supported yet Indicators.mqh 490 33

'[' - array required Indicators.mqh 490 37

'Lips' - function call missing, open parenthesis expected Indicators.mqh 490 33


// Single Buffer Indicator

class CiAlligator: public CIndicator
{
        public:
                int Init(string pSymbol, ENUM_TIMEFRAMES pTimeframe, int pJawPeriod,int pJawShift,int pTeethPeriod, int pTeethShift, int pLipsPeriod, int pLipsShift,ENUM_MA_METHOD,int pMethod,ENUM_APPLIED_PRICE ,int pPrice);
}; 


int CiAlligator::Init(string pSymbol, ENUM_TIMEFRAMES pTimeframe, int pJawPeriod,int pJawShift,int pTeethPeriod, int pTeethShift, int pLipsPeriod, int pLipsShift,ENUM_MA_METHOD,int pMethod, ENUM_APPLIED_PRICE ,int pPrice)
{
        handle = (pSymbol,pTimeframe,pJawPeriod,pJawShift,pTeethPeriod,pTeethShift,pLipsPeriod,pLipsShift,pMethod,pPrice);
        return(handle);
}



// Multi-Buffer Indicator

class CiAlligator : public CIndicator
{
        private:
                double Jaws[];
                double Teeth[];
                double Lips[];
                
        public:
                int Init(string pSymbol, ENUM_TIMEFRAMES pTimeframe, int pJawPeriod,int pJawShift,int pTeethPeriod, int pTeethShift, int pLipsPeriod, int pLipsShift,ENUM_MA_METHOD,int pMethod, ENUM_APPLIED_PRICE ,int pPrice);
                double Jaws(int pShift=0);
                double Teeth(int pShift=0);
                double Lips(int pShift=0);
                CiAlligator();
}; 


CiAlligator::CiAlligator()
{
        ArraySetAsSeries(Jaws,true);
        ArraySetAsSeries(Teeth,true);
        ArraySetAsSeries(Lips,true);
}
 

int CiAlligator::Init(string pSymbol, ENUM_TIMEFRAMES pTimeframe, int pJawPeriod,int pJawShift,int pTeethPeriod, int pTeethShift, int pLipsPeriod, int pLipsShift,ENUM_MA_METHOD,int pMethod, ENUM_APPLIED_PRICE ,int pPrice)
{
        handle = iAlligator(pSymbol,pTimeframe,pJawPeriod,pJawShift,pTeethPeriod,pTeethShift,pLipsPeriod,pLipsShift,pMethod,pPrice);
        return(handle);
}


double CiAlligator::Jaws(int pShift=0)
{
        CopyBuffer(handle,1,0,MAX_COUNT,Jaws);
        double value = NormalizeDouble(Jaws[pShift],_Digits);
        return(value); 
} 


double CiAlligator::Teeth(int pShift=0)
{
        CopyBuffer(handle,1,0,MAX_COUNT,Teeth);
        double value = NormalizeDouble(Teeth[pShift],_Digits);
        return(value); 
}   

double CiAlligator::Lips(int pShift=0) 
{
        CopyBuffer(handle,1,0,MAX_COUNT,Lips);
        double value = NormalizeDouble(Lips[pShift],_Digits);//error line please help
        return(value); 
} 
 
Vladimir Karputov:

Where is your question? It is not clear what you are asking about. Where is your MQL5 code?

Sir, I add it.

 
Cannot be compiled. Show the whole project.
 

I have problem in inserting parameters
, it show this error

'Init' - no one of the overloads can be applied to the function call Bands RSI jadid.mq5 121 12

could be one of 2 function(s) Bands RSI jadid.mq5 121 12

   int CiAlligator::Init(string,ENUM_TIMEFRAMES,int,int,int,int,int,int,ENUM_MA_METHOD,ENUM_APPLIED_PRICE) Indicators.mqh 435 7

   int CIndicator::Init() Indicators.mqh 36 15

//+------------------------------------------------------------------+
//|                                           Bands/RSI CounterTrend |
//|                                                     Andrew Young |
//|                                 http://www.expertadvisorbook.com |
//+------------------------------------------------------------------+

#property copyright "Andrew Young"
#property link      "http://www.expertadvisorbook.com"
#property description "A counter-trend trading system using Bollinger Bands and RSI"

/*
 Creative Commons Attribution-NonCommercial 3.0 Unported
 http://creativecommons.org/licenses/by-nc/3.0/

 You may use this file in your own personal projects. You
 may modify it if necessary. You may even share it, provided
 the copyright above is present. No commercial use permitted. 
*/


// Trade
#include <Mql5Book\Trade.mqh>
CTrade Trade;

// Price
#include <Mql5Book\Price.mqh>
CBars Bar;

// Money management
#include <Mql5Book\MoneyManagement.mqh>

// Trailing stops
#include <Mql5Book\TrailingStops.mqh>
CTrailing Trail;

// Timer
#include <Mql5Book\Timer.mqh>
CTimer Timer;
CNewBar NewBar;

// Indicators 
#include <Mql5Book\Indicators.mqh>
CiAlligator Alligator;
CiCCI CCI;


//+------------------------------------------------------------------+
//| Input variables                                                  |
//+------------------------------------------------------------------+

input ulong Slippage = 3;
input bool TradeOnNewBar = true;

sinput string MM;       // Money Management
input bool UseMoneyManagement = true;
input double RiskPercent = 2;
input double FixedVolume = 0.1;

sinput string SL;       // Stop Loss & Take Profit
input int StopLoss = 0;
input int TakeProfit = 0;

sinput string TS;               // Trailing Stop
input bool UseTrailingStop = false;
input int TrailingStop = 0;
input int MinimumProfit = 0;
input int Step = 0; 

sinput string BE;               // Break Even
input bool UseBreakEven = false;
input int BreakEvenProfit = 0;
input int LockProfit = 0;

sinput string Alli;             // Bollinger Bands
input int JawPeriod = 13;
input int JawShift = 8;
input int TeethPeriod = 8;
input int TeethShift = 5;
input int LipsPeriod = 5;
input int LipsShift = 3;
input double AlligatorMethod = MODE_SMMA;
input ENUM_APPLIED_PRICE AlligatorPrice = PRICE_MEDIAN; 

sinput string CC;       // RSI
input int CCIPeriod = 14;
input ENUM_APPLIED_PRICE CCIPrice = PRICE_CLOSE;

sinput string TI;       // Timer
input bool UseTimer = false;
input int StartHour = 0;
input int StartMinute = 0;
input int EndHour = 0;
input int EndMinute = 0;
input bool UseLocalTime = false;



//+------------------------------------------------------------------+
//| Global variables                                                 |
//+------------------------------------------------------------------+

bool glBuyPlaced, glSellPlaced;

enum Signal
{
        SIGNAL_BUY,
        SIGNAL_SELL,
        SIGNAL_NONE,
};

Signal glSignal;


//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

int OnInit()
{  
          
        Alligator.Init(_Symbol,_Period,JawPeriod,JawShift,TeethPeriod,TeethShift,LipsPeriod,LipsShift,AlligatorMethod,AlligatorPrice);
        CCI.Init(_Symbol,_Period,CCIPeriod,CCIPrice);
        
        Trade.Deviation(Slippage);
   return(0);
}



//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+

void OnTick()
{

        // Check for new bar
        bool newBar = true;
        int barShift = 0;
        if(TradeOnNewBar == true) 
        {
                newBar = NewBar.CheckNewBar(_Symbol,_Period);
                barShift = 1;
        }
        
        
        // Timer
        bool timerOn = true;
        if(UseTimer == true)
        {
                timerOn = Timer.DailyTimer(StartHour,StartMinute,EndHour,EndMinute,UseLocalTime);
        }
        
        
        // Update prices
        Bar.Update(_Symbol,_Period);
        
        
        // Order placement 
        if(newBar == true && timerOn == true)
        {
                
                // Money management
                double tradeSize;
                if(UseMoneyManagement == true) tradeSize = MoneyManagement(_Symbol,FixedVolume,RiskPercent,StopLoss);
                else tradeSize = VerifyVolume(_Symbol,FixedVolume);
                
                
                if(Bar.Close(barShift) < Alligator.Jaw(barShift) && CCI.Main(barShift) < 30) glSignal = SIGNAL_BUY;
                else if(Bar.Close(barShift) > Alligator.Lips(barShift) && CCI.Main(barShift) > 70) glSignal = SIGNAL_SELL;
                
                
                // Open buy order
                if(glSignal == SIGNAL_BUY && Bar.Close(barShift) > Alligator.Jaw(barShift) && Bar.Close(barShift+1) <=  Alligator.Jaw(barShift+1)) 
                {
                        glBuyPlaced = Trade.Buy(_Symbol,tradeSize);
                
                        if(glBuyPlaced == true)  
                        {
                                do(Sleep(100)); while(PositionSelect(_Symbol) == false);
                                double openPrice = PositionOpenPrice(_Symbol);
                                
                                double buyStop = BuyStopLoss(_Symbol,StopLoss,openPrice);
                                if(buyStop > 0) AdjustBelowStopLevel(_Symbol,buyStop);
                                
                                double buyProfit = BuyTakeProfit(_Symbol,TakeProfit,openPrice);
                                if(buyProfit > 0) AdjustAboveStopLevel(_Symbol,buyProfit);
                                
                                if(buyStop > 0 || buyProfit > 0) Trade.ModifyPosition(_Symbol,buyStop,buyProfit);
                                
                                glSignal = SIGNAL_NONE;
                        } 
                }
                
                
                // Open sell order
                if(glSignal == SIGNAL_SELL && Bar.Close(barShift) <  Alligator.Lips(barShift) && Bar.Close(barShift+1) >=  Alligator.Lips(barShift+1)) 
                {
                        glSellPlaced = Trade.Sell(_Symbol,tradeSize);
                        
                        if(glSellPlaced == true)
                        {
                                do(Sleep(100)); while(PositionSelect(_Symbol) == false);
                                double openPrice = PositionOpenPrice(_Symbol);
                                
                                double sellStop = SellStopLoss(_Symbol,StopLoss,openPrice);
                                if(sellStop > 0) sellStop = AdjustAboveStopLevel(_Symbol,sellStop);
                                
                                double sellProfit = SellTakeProfit(_Symbol,TakeProfit,openPrice);
                                if(sellProfit > 0) sellProfit = AdjustBelowStopLevel(_Symbol,sellProfit);
                                
                                if(sellStop > 0 || sellProfit > 0) Trade.ModifyPosition(_Symbol,sellStop,sellProfit);
                                
                                glSignal = SIGNAL_NONE;
                        } 
                }
                
        }       // Order placement end
        
        
        // Break even
        if(UseBreakEven == true && PositionType(_Symbol) != -1)
        {
                Trail.BreakEven(_Symbol,BreakEvenProfit,LockProfit);
        }
        
        
        // Trailing stop
        if(UseTrailingStop == true && PositionType(_Symbol) != -1)
        {
                Trail.TrailingStop(_Symbol,TrailingStop,MinimumProfit,Step);
        }


}