Currency Strength Algorithm

MQL5 Эксперты

Работа завершена

Время выполнения 20 часов
Отзыв от заказчика
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
Отзыв от исполнителя
Happy to help

Техническое задание

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!


Откликнулись

1
Разработчик 1
Оценка
(322)
Проекты
499
67%
Арбитраж
5
40% / 0%
Просрочено
4
1%
Свободен
Опубликовал: 8 примеров
2
Разработчик 2
Оценка
(5)
Проекты
7
29%
Арбитраж
0
Просрочено
0
Свободен
Похожие заказы
Hello, I have a very simple TradingView (Pine Script) indicator that I want to be converted and implemented in ATAS . The logic is straightforward, with no complex calculations or strategy execution. I will provide the TradingView script and full explanation of how it works . What I Need: Convert the existing TradingView script logic to ATAS Ensure the indicator behaves the same way as on TradingView Clean
hello great developer We are looking for someone to create a Ninja Trader bot that can identify liquidity sweeps using lux algos indicator. once liquidity sweep occurs we need the bot to use the fibonnachi tool to idenfity the 61% level and 71% level. then enter the trade for us please check the video for better understanding Here is first video: https://youtu.be/ZaGZGNgzZlc?si=we3poeWB91nWqkz5 Here is Second video
I already have a preliminary economic calendar panel. I need to optimize it to add trading functions and UI elements. What I'm looking for is an interactive control panel for trading
Beschreibung: Ich suche einen erfahrenen MQL5-Entwickler, der meinen bestehenden Expert Advisor für MT5 fertigstellt und optimiert. Der EA basiert auf einer 30-Minuten-Breakout-Strategie für XAUUSD (Gold) und enthält bereits die Grundlogik sowie FTMO-Regeln (Tagesverlust, Gesamtverlust, Handelszeiten, Spread-Filter, Lotbegrenzung). Was gemacht werden muss: Code-Feinschliff und Debugging Überprüfung der Breakout-Logik
Greeting Im in need of a programmer that can help me convert from TOS to trading view? The script is available with me, kindly bid if it is what you can do for me Thanks
I need an MT4 Expert Advisor based on my existing manual trading system. PLATFORM: - MetaTrader 4 (MT4 only) TIMEFRAMES: - Main version: M30 entries with H1 structure - Second mode: M5 entries with M30 structure - Both modes should be inside ONE EA (switch by input) INDICATORS (already available on my chart as external indicators): 1) SuperTrend - ATR period: 10 - Multiplier: 1.7 2) XXSS Candle - Same settings
can you help me with I need an ATM strategy for NT8, here's the criteria: Forex trade entry 100,000 units with a starting SL of 70 pips. The following proft targets: 33 pips, 68, 125, 180. All targets exit 25,000 units each. As each target is hit, move SL to BE+5, then BE+35, then BE+70. So the SL's are fixed, not trailing. I can't figure this out on my platform
I need a robot advisory based on AOX signals. It must be the main criteria for opening and closing. The price should be higher than the previous bar Trades
"I need a high-quality, non-repainting TradingView indicator for Gold (XAUUSD) on the 1-minute timeframe. The goal is to catch 'Tops and Bottoms' using a combination of price exhaustion and candlestick confirmation. Key Requirements: The Signal: Must identify reversals at extremes. Please use a combination of Bollinger Bands (Standard Deviation) and RSI . Candlestick Confirmation: Signals should only fire if there is
Looking for an MT4 expert advisor that complies with prop firm rules, mainly DD Max 4-5%. No martingale, no recovery. Only 1 trade at a time. Source code. Please send a 24 hours demo for me to test. Please DO NOT send me a history reader. Most unprofessional. All the best, and I look forward to hearing from you

Информация о проекте

Бюджет
30+ USD
Сроки выполнения
от 1 до 2 дн.