Currency Strength Algorithm

MQL5 Experts

Job finished

Execution time 20 hours
Feedback from customer
I hired Navdeep to help me work on a personal project where my ability with MQL5 was lacking. He completed the job within a few hours and helped me with numerous questions after the handover
Feedback from employee
Happy to help

Specification

Hello,

I have developed a strategy but I'm struggling to write the MQL5 code and it's easier for me to get some help rather than continue struggling.

I will explain the part of the strategy I need help with in basic code but I need help writing this in MQL5 as 1. I can't figure out how to calculate the moving average of a source that isnt OHLC, and 2. I cant think how to store that as an array. I have commented the sections below:


lookback_period = 50

//------ Get RSI Values for all 28 Pairs

double audcad = rsi("AUDCAD",lookback_period)
double audchf = rsi("AUDCHF",lookback_period)
double audjpy = rsi("AUDJPY",lookback_period)
double audnzd = rsi("AUDNZD",lookback_period)
double audusd = rsi("AUDUSD",lookback_period)
double cadchf = rsi("CADCHF",lookback_period)
double cadjpy = rsi("CADJPY",lookback_period)
double chfjpy = rsi("CHFJPY",lookback_period)
double euraud = rsi("EURAUD",lookback_period)
double eurcad = rsi("EURCAD",lookback_period)
double eurchf = rsi("EURCHF",lookback_period)
double eurgbp = rsi("EURGBP",lookback_period)
double eurjpy = rsi("EURJPY",lookback_period)
double eurnzd = rsi("EURNZD",lookback_period)
double eurusd = rsi("EURUSD",lookback_period)
double gbpaud = rsi("GBPAUD",lookback_period)
double gbpcad = rsi("GBPCAD",lookback_period)
double gbpchf = rsi("GBPCHF",lookback_period)
double gbpjpy = rsi("GBPJPY",lookback_period)
double gbpnzd = rsi("GBPNZD",lookback_period)
double gbpusd = rsi("GBPUSD",lookback_period)
double nzdcad = rsi("NZDCAD",lookback_period)
double nzdchf = rsi("NZDCHF",lookback_period)
double nzdjpy = rsi("NZDJPY",lookback_period)
double nzdusd = rsi("NZDUSD",lookback_period)
double usdcad = rsi("USDCAD",lookback_period)
double usdchf = rsi("USDCHF",lookback_period)
double usdjpy = rsi("USDJPY",lookback_period)

//----- Find Individual Currency Strength

double aud = (audcad+audchf+(100-euraud)+(100-gbpaud)+audjpy+audnzd+audusd)/7;
double cad = ((100-audcad)+cadchf+(100-eurcad)+(100-gbpcad)+cadjpy+(100-nzdcad)+(100-usdcad))/7;
double chf = ((100-audchf)+(100-cadchf)+(100-eurchf)+(100-gbpchf)+chfjpy+(100-nzdchf)+(100-usdchf))/7;
double eur = (euraud,eurcad+eurchf+eurgbp+eurjpy+eurnzd+eurusd)/7;
double gbp = (gbpaud,gbpcad+gbpchf+(100-eurgbp)+gbpjpy+gbpnzd+gbpusd)/7;
double jpy = ((100-audjpy)+(100-cadjpy)+(100-chfjpy),(100-eurjpy)+(100-gbpjpy)+(100-nzdjpy)+(100-usdjpy))/7;
double nzd = ((100-audnzd)+nzdcad+nzdchf+(100-eurnzd)+(100-gbpnzd)+nzdjpy+nzdusd)/7;
double usd = ((100-audusd)+usdcad+usdchf+(100-eurusd)+(100-gbpusd)+usdjpy+(100-nzdusd))/7;



//---- Now I need a function to take one of the individual currency strengths and calculate 2 moving averages, subtracting the smaller moving average from the larger one. The problem is 1. finding the moving average of a source that isnt OHLC, and 2. storing that as an array to be able to identify crossovers etc:

int signal(double data_currency)
{
        int signal_output = 0;

        delta[] = ema(data_currency,50) - ema(data_currency,200) // This needs to be an array so that I can calculate when delta crosses above or below 0. This is the entry criteria
        
        if(delta[0] > 0 && delta[1] < 0) //delta crosses above 0
                signal_output = 1;

        if(delta[0] < 0 && delta[1]) > 0 //delta below above 0
                signal_output = -1;

        return(signal_output);
}
    


This should be a simple fix for someone who knows the solution!


Responded

1
Developer 1
Rating
(322)
Projects
498
67%
Arbitration
5
40% / 0%
Overdue
4
1%
Free
Published: 8 codes
2
Developer 2
Rating
(5)
Projects
7
29%
Arbitration
0
Overdue
0
Free
Similar orders
Description: We are looking for an experienced MT4/MT5 EA developer to build a fully automated trading bot for BTCUSD (M15 timeframe) . The EA should combine chart pattern recognition, candlestick analysis, and a grid trading system with automated trade management. ✅ Requirements: 1. Chart & Candlestick Pattern Recognition Identify Head and Shoulders and Inverted Head and Shoulders patterns. Recognize key candlestick
Hello, good day to you Developers, I am looking for someone that can deliver on a project with the following requirements: The job I am about to give out will involve "Tradingview" and "cTrader" Tradingview: for analysis, as the Strategy uses one second charts/candles, cTrader: for executing and managing the trades. - For this cBot to work well for the project's aims, SPEED of execution is of upmost importance. - The
Job Description: · I am looking for an experienced MQL4 developer to create a high-speed scalping EA for US30 and DE40. The EA must be optimized for ultra-fast execution and should not rely on any indicators—only price action and pending orders (Buy Stop & Sell Stop). · I have written a complete and detailed documentation outlining the logic, execution flow, risk management, and required settings
The following Logic should be created example entryprice 3000 SL in the beginning 2996 Price reaches Entrpy oint = 3000 nothing happens Price reaches Entry point +NowTrailingSL_value(=2.0) price is then 3002 SL is moved to = 3000.20 ( is 3000+ 0.20) Price reaches Entry point +TopOnNowTrailingStoplossValue(=4.0) price is then 3004 SL is still 3000.20 Nothing happens Price reaches Entry point
I 'm contacting you because I'm currently managing an Excel project that centralizes the results monitoring of my trading accounts and the technical characteristics of my Expert Advisors (EAs) . The current system consists of several linked spreadsheets where : • Trading data is automatically uploaded from FXBlue/CSV • Key metrics are consolidated (Win Rate, Profit Factor, Expectancy, SQN, Drawdown, MAR , etc.) •
Looking for an EA that has been previously tested and can pass prop firm challenges. You will need to demonstrate the EA to showcase true nature. Please only apply if you have a system ready. This can be a previous job you already done for someone or have something in the files
Mthizo trades 30 - 200 USD
- *Currency Pairs*: Major pairs such as EUR/USD, XAU/USD and GBP/USD - *Funding Currency*: South African Rand (ZAR) - *Initial Deposit*: R100 (may require additional deposit for live trading) - *Risk Management*: Basic risk management features, such as stop loss and take profit - *Strategy*: Pre-defined strategy based on Smart Money Concept principles - *Cost*: Approximately R100-R200 (one-time cost or
I am interested in purchasing a ready-made automated EA (Expert Advisor) that is already tested and profitable. My key requirements are: Consistent profits with proven results (backtests and/or live performance) Low to medium risk, not overly aggressive Works on major forex pairs, indices, or gold Ready to use with minimal setup If you have an EA that meets these criteria, please share details, performance records
Robot (metatrader5) 30 - 200 USD
I need an Expert Advisor (EA) for MetaTrader 5 that trades only XAUUSD (Gold). The strategy should include: • EMA (50) on M15 timeframe • RSI (14) with overbought = 70 and oversold = 30 • ATR (14) for Stop Loss and Take Profit calculation • Higher timeframe EMA (200 on H1) as trend filter • Lot size calculation based on risk percentage (% of balance) • Magic number for trade identification • Trading hours: 07:00 –
I am good in coding. I am a Quant Developer in a Company. I like to create the idea in to code. I love to code in C++, Python and MQL

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
from 1 to 2 day(s)