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

MQL5 Indicatori Esperti

Lavoro terminato

Tempo di esecuzione 1 giorno
Feedback del cliente
Good developer, recommend to anyone
Feedback del dipendente
Great customer. Clear description of requirement specification, fast communication. Looking forward to working with you again. Thanks

Specifiche

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



Con risposta

1
Sviluppatore 1
Valutazioni
(237)
Progetti
298
28%
Arbitraggio
33
24% / 61%
In ritardo
9
3%
In elaborazione
2
Sviluppatore 2
Valutazioni
(322)
Progetti
499
67%
Arbitraggio
5
40% / 0%
In ritardo
4
1%
Gratuito
Pubblicati: 8 codici
Ordini simili
Need a EA which follow our zone when its reach to a certain zone then it give us signal that market already reach the zone now create Entry Zone. also need BE, SL , TP options regards
I have an EA that work ---I don't need any changes or improvements. The EA creates its own brain file to save data of learned algo's. It is an AI EA. The EA can save data to the brain file, but upon startup, it can't retrieve the data from the brain file and start training from 0 again. It is supposed to save data and use the learned information on startup
Hi, Firstly I would like to clarify that I am a total noob to the MT5 platform, and would need help to load and back-test the sample EA that you provide, so please provide me step-by-step guidance, including the best methods to run the EA 24/7. I need to make an EA for use on MT5, on a simple strategy based on the yesterday's close. Below is the strategy where I should be able to change the variables: Entry Timings
I want the Robots to execute buy/sell/TP/SL trades without me telling them to, Buy low Sell high Forex Pairs, I want to gain profit not lose profit, using INDICATORS, strategies, Expert Advisors, signals, Symbols, MA RSI, Awesome Accelerators', Algorithmic Trading and Scanners on real time data
I need a nice dashboard template, futuristic, reasonable color for my EA, MT5. You need to send me your demo template, don't start with meaningless words..< 50star dont conttact me
""" Fast Multi-Pair RSI Trading Bot Supports: - BTCUSDT - XAUUSD - GBPUSD Opens fast buy or sell trades based on RSI signals Closes trades after 5, 10, or 15 minutes """ import asyncio import time from dataclasses import dataclass, field from typing import Dict, List, Optional import pandas as pd import numpy as np # ===== RSI calculation ===== # def compute_rsi(close: pd.Series, period: int = 14) -> pd.Series
+ The indicator displays the Order block buy (blue) and sell (red) zones, liquidity zones, and arrow-shaped entry signals. + The EA can enter orders according to the trading signals in the indicator. It has made money in practice, or won in backtest. + Developer has available indicator or ea for testing rightnow (MT4/MT5) Note: 1. If you have files for backtesting, please list the Symbols that it made money on. 2. If
Asithwale 30+ USD
I want a trading robot sp that at med nights I no that I have a trading robot for me and I will not be worried the I must start trading so if I use a trading robot in my trading account I just looked at the robot trading for me
A robot 30+ USD
Hy I am looking for someone who can make a robot for me using one minute strategy..I have a video to show you how orders should opens entries..when the profit is great than 0 we close profit in one minutes candle or when all the orders are in profit it close the profit
have an MT5 Expert Advisor (EA) that requires professional attention. The tasks are: 1. Debug the EA and fix any errors. 2. Optimize the EA input parameters for best performance. 3. Run strategy tests and provide a detailed report including: - Profit - Drawdown - Trade log - Recommendations Requirements: - Experience with MT5 EA debugging, optimization, and backtesting. - Able to deliver updated .mq5/.ex5

Informazioni sul progetto

Budget
40+ USD
Scadenze
a 1 giorno(i)