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

MQL5 Indicadores Experts

Trabalho concluído

Tempo de execução 1 dia
Comentário do cliente
Good developer, recommend to anyone
Comentário do desenvolvedor
Great customer. Clear description of requirement specification, fast communication. Looking forward to working with you again. Thanks

Termos de Referência

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



Respondido

1
Desenvolvedor 1
Classificação
(131)
Projetos
152
22%
Arbitragem
5
0% / 60%
Expirado
4
3%
Carregado
2
Desenvolvedor 2
Classificação
(282)
Projetos
422
63%
Arbitragem
5
40% / 0%
Expirado
4
1%
Trabalhando
Pedidos semelhantes
I want a skillful and experience deverloper to apply for this job. The strategy for the EA is Two Exponential Moving Average CROSSOVER strategy. The EA should work on any Timeframe. I want the EA to trade the direction of the CROSSOVER, the EA should open a BUY or SELL trades automatic when the Two Exponential Moving Average crossover. *(10EMA) ABOVE (23EMA) = BUY Trades *(10EMA) BELOW (23EMA) = SELL Trades BUY
MACD EA 50+ USD
Hello Freelancers, I am seeking an experienced developer to create an Expert Advisor (EA) for MetaTrader 5 (MT5). The EA will be based on the MACD indicator and should adhere to the following specifications: EA Requirements: Trading Logic: 1. Long Trades: • Entry: Open a long trade when the MACD line crosses above the signal line below the zero level. • Exit: Close the long trade when the signal line crosses above
EA Configuration. FIBO ------------------------------------------------------------------- Magic: 123456 Stop: Real or Virtual Order: Pending / CLOSE / price== LOT Description: 0.01 ------------------------------------------------------------------- STOP: -0.25 ------------------------------------------------------------------- ENT_1: 1.00 Lot_1: 0.01 ENT_2: 0.50 Lot_2: 0.01 ENT_3: 1.00 Lot_3: 0.01
Hi I'm looking for a professional programmer to modify my EA the EA send signal alert to telegram and screen shot of the chart patterns my EA is dased to the harmonic pattern but I want to see on the screen shot the pattern of the harmonic pattern and on the chat as well
Hello I need create simple trend first candle session EA. Ea wait for first M5/M15/M30/H1 (all possible timeframes to choose) candle at asian, european and NYC session and open buy/sell stop order above (in long situation) or below (in short situation) x points from highest/lowest point of the first candle. + trailing stop loss stop loss take profit breakeven magic key
Hello Guys ! Looking for a developer to create a EA for my Buy and Sell No repaint indicator. I only have the EX4 indicator file and I want the EA to take trades according to the Buy and sells signals generated by the Indicator. Here are some inputs I want for the EA: - Trailing stop - TP and SL ( in pips ) - Entries, TP and SL ( based on opposite signals arrow ) - Daily target ( in Dollars $ or % ) - Trading hours -
I need a robot that copies the orders sent in the telegram group to MT4 or MT5 so that I can configure the parameters. I would like it to have functions so I can enter and exit negotiations according to my configuration parameters
i need to delegate this job. XAUUSD H4 MT4 i have an ea with source code with smc, fvg, orderblocks and fibonacci, i need to fix somethings and add some features for live markets, any new ideas are accepted, i need also a 4 years backtest report (of metatrader 4). if you have good price and feedbacks and you want work for me also for new jobs apply for this job it's not urgent i need only a good price
Hello, I hope you are well. I have an alert/s that I would like to provide buy and sell orders. The alerts are named *ENTRY* and *EXIT*, so the EA will know what to do. I would like the EA to have the following parameters: 1. Select the number of trades per currency pair 2. Time to trade: Time to start trading to time to end trading - I would like 4 different times to be able to be entered 3. Option to choose which
Order Manager 30 - 60 USD
I am looking for a programmer to develop an Expert Advisor (EA) for order management, which will be used alongside simpler EAs. This EA should include advanced functionalities for efficient and personalized management. **Key Features:** 1. **Comprehensive Information Panel:** - **Order Visualization:** Display all open orders by currency pair, including short and long positions. - **Font Resizing Option:** Allow

Informações sobre o projeto

Orçamento
40+ USD
Desenvolvedor
36 USD
Prazo
para 1 dias