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
499
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
This Expert Advisor (EA) will use a custom indicator that connects all Higher Lows (HL), Higher Highs (HH), Lower Highs (LH), and Lower Lows (LL) using a continuous line. The line structure created by this indicator will be used to detect a valid W pattern for BUY trades
I already have an EA and willing to work together with a talented professional programmer so that we can make a profitable EA for the long-term. RazorQuant AI | Buy Trading Robot (Expert Advisor) for MetaTrader 5 RAZORQUANT AI v3.7 (MT5 EA) Purpose: Automated trading EA that combines classic technical filters with machine-learning signals and optional external AI (LLM) advice to decide BUY/SELL/HOLD and manage
I’m looking to develop an MT5 Expert Advisor based on a breakout and retracement strategy . Below is the core logic of the EA: Identify and mark the daily high and daily low Place a Buy Stop above the daily high and a Sell Stop below the daily low, using a 40-pip buffer Once a pending order is triggered: Set Stop Loss and Take Profit dynamically using ATR Apply an ATR-based trailing stop If price continues moving in
Hi, I’m looking for an experienced MT5 EA developer to build an Expert Advisor based on Elliott Wave and Fibonacci strategies . I’m specifically seeking a developer who already understands these strategies well and can actively advise on the best implementation approach , not someone who simply asks me what to build. I want to collaborate with a developer who can contribute ideas and structure the logic to achieve
Pre pending order EA 30 - 40 USD
Hey developers I want to code for me good pre pending order EA with a good strain stop loss, break out logic, MT5, it can trade starting from 20&, pre pending breakout logic , trend filter trades Xauus , Eurusd trades real breakouts
Range Reversal EA 29/01/26 Rev 0 Overview This EA will bound a range of price action over a set time. At a specified time range a trade will be enabled if price action triggers a reversal at or near to the bound range, by a stated offset. Typically the EA will be permitted to only take one trade per day. The EA is not to operate on Weekends. The EA will be left running on a MT5 platform on a server. Testing I will
Hello dear all developers, I am searching a programmer with experience with self-learning EA based on Ai. More details will be discussed with selected candidates. Source of code required, but it's obvious. Budget is negotiable
I am looking of an Expert Advisor (EA) that has undergone independent validation and demonstrates a capability to successfully navigate prop firm challenges, as well as efficiently manage funded accounts. It is imperative that you provide a comprehensive explanation of the strategy utilised by your EA, along with a demo version that has a 30-day expiration. This will facilitate extensive back testing and forward
EA WITH A DASHBOARD TO CHOSE THE TRADING MODE : AUTO (USING INDICATOR) OR MANUALLY I CAN CHOSE THE TRADING MODE : BUY OR SELL , OR NO TRADE . THERE WILL BE A MULTI TRADING TIME PERIODS AND EACH PERIOD HAS ITS WON TARGET THE EA WILL CLOSE ALL POSITIONS IF THE PERIOD TARGET HIT. TO OPEN BUY OR SELL THERE ARE TWO SENARIOS FOR EACH OF THEM MORE CHATRS AND DETAILS WILL PROVIDED TO THE CANDIDATES GOOD LUCK
On a new M15 candle, wait 4 minutes , then track the candle High and Low continuously . Important to begin all this process the 1st 4 min. the distance between the high and low not less than 8 USD$. Place Sell Stop at the candle High and Buy Stop at the candle Low . If a new High or new Low forms, cancel all pending orders , recalculate, and place new ones. One minute before candle close , delete all pending orders

Project information

Budget
30+ USD
Deadline
from 1 to 2 day(s)