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

MQL5 Indicators Experts

Job finished

Execution time 1 day
Feedback from customer
Good developer, recommend to anyone
Feedback from employee
Great customer. Clear description of requirement specification, fast communication. Looking forward to working with you again. Thanks

Specification

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;
}



Responded

1
Developer 1
Rating
(131)
Projects
152
22%
Arbitration
5
0% / 60%
Overdue
4
3%
Loaded
2
Developer 2
Rating
(282)
Projects
422
63%
Arbitration
5
40% / 0%
Overdue
4
1%
Working
Similar orders
Hello developers I hope this message finds you well. I am currently seeking a highly skilled developer for an important project. I need an exact copy of a TradingView indicator to be coded for the MetaTrader 4/5 platform. The indicator must be replicated with absolute precision, maintaining all its functionalities and features. Would you be able to take on this project? If so, I would appreciate discussing the
Hello Developers, I am looking for a highly skilled and experienced developer to code an exact copy of a specific indicator for TradingView. The indicator must be replicated with precise accuracy, maintaining all functionalities and features of the original. Requirements: Proficiency in Pine Script and experience with TradingView indicators. Demonstrated ability to replicate complex indicators with exact
MODIFICATION OF AND EXISTING EXPERT BY ADDING INDICATORS TO FUNCTION AS FILTERS, TRADE CLOSURE BY THE REVERSAL OF THE adx INDICATOR, LOOKING FOR TRADE BASED ON THE COLOR OF THE PERCENTAGE CHANGE INDICATOR (DPC) SELLING THE COLR IS RED AND DECREASING IN PERCENTAGE AND BUYING WHEN THE COLOR IS GREEN AND INCREASING IN PERCENTAGE . There is an EA I have been using which I splitted into long trading and short trading. It
I'm looking for very simple scanner dashboard based on Zigzag and I'm going to share more details to the right candidate. I want show some kinds of Signal when pattern match and when click from Dashboard it's opened new tab with chart and show that pattern. It should be use custom timeframe, Scan custom pair as well scan from Market Watch. Dashboard must be Responsive or adjust with any screen. It's based on Very
Looking for someone who can convert 130 Lines of Pinescript code to MT4/5 And I want extra input for scanning from Marketwatch and Custom Pairs. More details for the right candidate. And if you are high demand freelancer, please don't apply to this project. We're looking for someone who are individual and keep working with us. Thank you
i am looking for experienced programmer to create indicator for me. i am willing to pay for the service. and if it works amazingly like i expected. i will tip more money
I recently bought an indicator, that sends out notifications for trades i need to place, on the notification these and SL and TP, so i want an EA that would automate that for me
SMART MONEY 30 - 49 USD
--- Job Title: EA Programmer for Smart Money Concept (Urgent) Job Description: We are seeking an experienced EA programmer to finalize a project focused on implementing the Smart Money Concept. The progress is at 80%, and we need someone to complete the remaining tasks within a week. Project Requirements: - Liquidity, CHoCh, and Return to OrderBlock: Implement these key components effectively into the Expert Advisor
Hello developer Am looking for scanner of mt5 when the orange dot come I want scanner to give buy signal on that script and just beside it should show the number of candle the signal have came vise versa for sell . Here is image for understanding https://prnt.sc/sSIHDwGUWw9L&amp ;nbsp ; And it should have option to disable this option of counting candle . And i can make a list of symbol which all symbol I want to
I am looking for a tool that will calculate the max adverse excursion before a trade closes in profit or loss. The toll needs to analyse historical trades and record this value for each trade. The purpose is to assist me calculate the best stop loss for using a martingale system

Project information

Budget
40+ USD
For the developer
36 USD
Deadline
to 1 day(s)