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
Description Hello! I’m looking for an experienced MQL5 developer to build an MT5 Expert Advisor that can trade two opposite strategies on the same price levels : BREAKOUT (trend continuation) REVERSAL (pullback / reversal) Key idea: the EA must allow a fair comparison by using the same Trigger Bar logic for both strategies (touch/break event), so we can backtest different combinations of levels, timeframes, and
I’m looking for a profitable MT5 grid trading strategy with strong risk management that is designed to avoid account blowouts . The strategy can trade on any symbol, as long as capital preservation is the top priority. I’m interested in purchasing the EA together with the full source code , provided it meets my requirements. Please let me know if you have a suitable solution available
I recently purchased an off the shelf 'multiple positions executor' EA in order to open multiple trades simultaneously using MT5 however the orders would fail. It seems they would fail because the EA uses PIPs and the broker I use with MT5 uses Points. The EA was sending an order with SL/TP values that violated the broker’s symbol rules. I need an EA developed which Opens multiple market orders simultaneously
I would like an experienced developer to work with. I have an existing EA I would like to modify. The EA works well on demo account but for some reasons, is not profitable on live account. I want an experienced developer to optimise it for a live account. Note: I only have a trial version of the EA, I do not have the source code
Pilot RSI 30 - 3090 USD
Theory : The original calculation of RSI is (in short) the following : Add the changes up and changes down. From those sums, we can then calculate the RSI (Relative Strength Index). At that particular step Welles Wilder used what sometimes is called Wilders EM for smoother results, And that gives us space to [produce all sort of different RSIs by using different types of smoothing at the final step This version : It
Job Details — Gold M1 EMA Consolidation Pullback EA Description: * Fully automatic MT5 EA * Pair: Gold (XAUUSD) * Timeframe: M1 * Funded account use (strict risk rules) * Full source code (.mq5) with lifetime ownership required 🔹 Strategy Rules * Single EMA period = 15 * Buy: price breaks upward and stays above EMA * Sell: price breaks downward and stays below EMA 🔹 Consolidation Logic * Identify last valid swing
SLee ต่อไปนี้เป็นตัวอย่างเอกสารข้อกำหนดสำหรับการพัฒนาเครื่องมือ ช่วยซื้อขาย MACD Sample Expert Advisor ซึ่งมีอยู่ในแพ็กเกจมาตรฐานของ MetaTrader 5 1. แนวคิดของระบบการซื้อขายมีดังนี้ : จะเข้าซื้อขายเมื่อ เส้นหลักและเส้นสัญญาณ ของ MACD ตัดกันในทิศทางแนวโน้ม ปัจจุบัน 2. แนวโน้ม จะถูกกำหนดโดยใช้ ค่าเฉลี่ยเคลื่อนที่แบบเอ็กซ์โปเนนเชียล ( Exponential Moving Average หรือ EMA) ตามช่วงเวลาที่ระบุ (InpMATrendPeriod) หากค่า
Symbol: Xauusd Timeframe: i want to choose Entry: 2 bullish candles in a row= buy order 2 bearish candles in a row= sell order Lotsize: i want to choose Tp 10 pips ( but i want to choose) Sl 50 pips ( i want to choose) I want to achieve 10 pips of profit every day. So if the first trade of the day is profitable, the ea will stop trading for the rest of that day. If the stop loss is hit, then I will need 6 winning
Hello all developers! I want ready made prop firm EA that is making around 3% monthly or overal 36% per year +/- Only serious offers please, don't waste my and your time. I am not an idiot. Thank you very much for your attention. Price is negotiable. Source of code required. Can be MT5, but can be also MT4
For only developer who understand Chaos/ Profiunity trading system by Bill WIlliams, Create The Profitunity System Trading based on Bill Williams Chaos theory, Trade based on Trend Affirmation in Daily, entry in H4, using Williams Fractal, Williams Alligator, Awesome Oscillator, Accelerator Oscillator, Market Facilitation Index. Balance Line, entry on Reversal, add on while market show continuation sign. Please quote

Project information

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