Modify Code so that it Performs the Same as the Attached Indicator

MQL5 Indicateurs Experts

Tâche terminée

Temps d'exécution 1 jour
Commentaires du client
Good developer, recommend to anyone
Commentaires de l'employé
Great customer. Clear description of requirement specification, fast communication. Looking forward to working with you again. Thanks

Spécifications

This is a very straight forward request.

What I need is for the Bollinger Bands Buy / Sell functions below to perform the same as the indicator that is attached.

Delivery will comprise of a video / demonstration that the functions will work within an expert advisor / work in a similar manner to the indicator.

I've shared the following below:

  • Photo of Indicator (ibbfill2)
  • Functions Bollinger Bands Buy / Sell (these functions should match the conditions of the ibbfill2 indicator (i.e. when the Indicator shades Blue - that is the same as Bollinger Bands Buy / vice versa for Bollinger Bands Sell)
  • iBandsMQL4 Function (because MT5 does not have shift / a proper way to indicate the MAIN / UPPER / LOWER Bound) I have created this function. Note if you have an alternative, feel free to replace this.


Photo of Indicator:

Indicator Example



Functions - Bollinger Bands Buy & Sell:

bool BollingerBandsBuy(string symb)
{
    bool state = false;

    double bid = SymbolInfoDouble(symb, SYMBOL_BID);
    double ask = SymbolInfoDouble(symb, SYMBOL_ASK);
    double close = iClose(symb, PERIOD_M5, 1);

    static bool conditionMet[12]; // Array to store conditionMet for each symbol
    string symbols_group[] = {symb1, symb2, symb3, symb4, symb5, symb6, symb7, symb9, symb10, symb11, symb12 };
    int numSymbols = ArraySize(symbols_group);

    if (ArraySize(conditionMet) != numSymbols)
    {
        ArrayResize(conditionMet, numSymbols);
    }

    int symbolIndex = -1;
    for (int i = 0; i < numSymbols; i++)
    {
        if (symb == symbols_group[i])
        {
            symbolIndex = i;
            break;
        }
    }

    if (symbolIndex == -1)
    {
        Print("Symbol not found in the group.");
        return false;
    }

    //------------------------------------------------------------------------

    double iBandsMain1 = iBandsMQL4(symb, PERIOD_M15, 20, 2, 0, 1);
    double iBandsUpper1 = iBandsMQL4(symb, PERIOD_M15, 20, 2, 1, 1);
    double iBandsLower1 = iBandsMQL4(symb, PERIOD_M15, 20, 2, 2, 1);

    //------------------------------------------------------------------------

    //---------------------- Buy Condition Initial Trigger -------------------

    if (close > iBandsUpper1)
    {
        conditionMet[symbolIndex] = true;
    }
    else if (close < iBandsMain1)
    {
        conditionMet[symbolIndex] = false;
    }

    //---------------------- Condition Start ---------------------------

    if (conditionMet[symbolIndex] && ask > iBandsMain1)
    {
        state = true;
    }

    return state;
}


//-------------------------------------------------------------------------------------------------------------++

bool BollingerBandsSell(string symb)
{
    bool state = false;

    double bid = SymbolInfoDouble(symb, SYMBOL_BID);
    double ask = SymbolInfoDouble(symb, SYMBOL_ASK);
    double close = iClose(symb, PERIOD_M5, 1);

    static bool conditionMet[12]; // Array to store conditionMet for each symbol
    string symbols_group[] = {symb1, symb2, symb3, symb4, symb5, symb6, symb7, symb9, symb10, symb11, symb12 };
    int numSymbols = ArraySize(symbols_group);

    if (ArraySize(conditionMet) != numSymbols)
    {
        ArrayResize(conditionMet, numSymbols);
    }

    int symbolIndex = -1;
    for (int i = 0; i < numSymbols; i++)
    {
        if (symb == symbols_group[i])
        {
            symbolIndex = i;
            break;
        }
    }

    if (symbolIndex == -1)
    {
        Print("Symbol not found in the group.");
        return false;
    }

    //------------------------------------------------------------------------

    double iBandsMain1 = iBandsMQL4(symb, PERIOD_M15, 20, 2, 0, 1);
    double iBandsUpper1 = iBandsMQL4(symb, PERIOD_M15, 20, 2, 1, 1);
    double iBandsLower1 = iBandsMQL4(symb, PERIOD_M15, 20, 2, 2, 1);

    //------------------------------------------------------------------------

    //---------------------- Buy Condition Initial Trigger -------------------

    if (close < iBandsLower1)
    {
        conditionMet[symbolIndex] = true;
    }
    else if (close > iBandsMain1)
    {
        conditionMet[symbolIndex] = false;
    }

    //---------------------- Condition Start ---------------------------

    if (conditionMet[symbolIndex] && close < iBandsMain1)
    {
        state = true;
    }

    return state;
}

  • Note: I have added a conditionMet function to this so that I can store the boolean for the first time it exceeds the Upper Bollinger Band. I need this to work with multicurrencies hence the array that contains 12 symbols.


iBands MQL4 Function:

double iBandsMQL4(string symb, ENUM_TIMEFRAMES tf, int period, double StdDeviation, int line, int shift) 
{
    ENUM_TIMEFRAMES timeframe3 = TFMigrate(tf);

    int handleBB = iBands(symb, timeframe3, period, 0, StdDeviation, PRICE_CLOSE);

    double bbUpper[], bbLower[], bbMiddle[];
    ArraySetAsSeries(bbUpper, true);
    ArraySetAsSeries(bbLower, true);
    ArraySetAsSeries(bbMiddle, true);

    CopyBuffer(handleBB, BASE_LINE, 1, shift + 1, bbMiddle);
    CopyBuffer(handleBB, UPPER_BAND, 1, shift + 1, bbUpper);
    CopyBuffer(handleBB, LOWER_BAND, 1, shift + 1, bbLower);

    double iBandsValue;

    if (line == 0)
    {
        iBandsValue = NormalizeDouble(bbMiddle[shift], SymbolInfoInteger(symb, SYMBOL_DIGITS));
    }
    else if (line == 1)
    {
        iBandsValue = NormalizeDouble(bbUpper[shift], SymbolInfoInteger(symb, SYMBOL_DIGITS));
    }
    else if (line == 2)
    {
        iBandsValue = NormalizeDouble(bbLower[shift], SymbolInfoInteger(symb, SYMBOL_DIGITS));
    }
    else
    {
        iBandsValue = 0.0; // Default value in case of invalid line parameter
    }
   
    return iBandsValue;
}



Répondu

1
Développeur 1
Évaluation
(144)
Projets
170
23%
Arbitrage
7
29% / 43%
En retard
4
2%
Chargé
2
Développeur 2
Évaluation
(297)
Projets
441
64%
Arbitrage
5
40% / 0%
En retard
4
1%
Chargé
Commandes similaires
I would like to develop my own indicator on metatrader 4 and tradingview. We would start with a basic version that we would improve later. It is an indicator based on several analyses and which would provide several indications. I am looking for someone who can develop on MT4 and Mt5, initially I would like to do it on mt4 and then on mt5. If you have expertise in pinescript it is a plus because I would like to
I urgently require swift assistance to convert a complex indicator into a fully functional scanner, capable of automatically sending real-time data, alerts, and notifications via email, ensuring seamless integration and prompt delivery of critical information to facilitate informed decision-making and timely action
I need to improve the code of an indicator that is too heavy and slow when running and when used with iCustom in an EA. No other changes to the indicator are requested: the original features of the indicator should remain as theay are. I'll provide the indicator after job acceptance. I request final source code mq5 file. Thank you Regards
I have a mt5 indicator that is working perfectly but I will like to make it an expert advisor to have an automated trade. I will be glad if I can get a well experienced developer to execute this project. Thanks
O TRABALHO CONSISTE NA MUDANÇA DO HISTOGRAMA DO INDICADOR TREDN DIRECTION AND FORCE DSEMA SMOOTHED PARA O HISTOGRAMA DA FOTO ANEXA, OBEDECENDO AS TRES CORES VERDE (UP, VERMELHOR(DOWN) E CINZA(TREND). O MESMO TEM QUE ODECER O MESMO CALCULO E COLORIR DA MESMA FORMA POREM COM HISTOGRAMA DDE FORMATO DIFERENTE
If you are knowledgeable in hedging strategy we can chat. I created my simple EA using Fxdreema , so you only need to modify it for me. There are two parts of the EA , 1. Is the execution strategy 2. Is the money management strategy (hedging). I already created number 1 which is the execution of trades , I only need someone who can implement hedging in every orders the EA create. Additional Parameters needed. Trade
We are interested in a TradingView indicator that reads candlestick pattern shapes and shows the location of entry and exit points on a candlestick chart. What services do you provide related to this
Hello Im looking for professional trading developer who htf ready made trading with best and working strategy with low risk level with average of 30 to 60 percent profit margin, broker is not problem, any broker is welcomed and any trading pairs are welcomed as well
the sl doesnt work i want the tp logic to remain i need the trend direction fucntion tow ork i the trend is up then only buys if down only sells i need the fibo nacci fucntion to work as well and the flat zone function to work as well and i need the code to trade 1% of the balance //+------------------------------------------------------------------+ //| US500_EA.mq4 | //|
Connect from Mt4 via binary derive account api. I have a bot. You need to convert the bot to an indicator. After converting I need to connect with my binary deriv through api. I want to trade my derivative binary account through mt4. If anyone can setup via API then contact me

Informations sur le projet

Budget
40+ USD
Pour le développeur
36 USD
Délais
à 1 jour(s)