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
등급
(298)
프로젝트
443
64%
중재
5
40% / 0%
기한 초과
4
1%
작업중
2
개발자 2
등급
(5)
프로젝트
7
29%
중재
0
기한 초과
0
무료
비슷한 주문
Creating of an expert advisor or trading bot that uses a Top Down analysis (using monthly, weekly, daily, hourly, minutes ( 30, 15, 5, 1) to determine trade direction or trend direction and makes multiple trade decisions for mt4. You can use or combine accurate trend indicators
Hello The EA will work on particular zone choose by the user and can mark it on any TF and with some rules can open trades and mange the trade by some unique rules. the EA need to check the difference by RSI as well and with some extra rules . developer should have good attitude and good communication (englsih) with high performence and knowledge with coding EA
I am looking forward to automate my trading strategy where I use renko bars on Tradingview. I really want to use unirenkos too, but unfortunately I couldn't figure out how to use ninjatrader on my MacBook and Tradingview does not offer unirenkos. As far as I see from your offered services you are very familiar with ninjatrader. I wanted to ask you if you could code me an Indicator for unirenkos for Tradingview so I
I am looking forward to automate my trading strategy where I use renko bars on Tradingview. I really want to use unirenkos too, but unfortunately I couldn't figure out how to use ninjatrader on my MacBook and Tradingview does not offer unirenkos. As far as I see from your offered services you are very familiar with ninjatrader. I wanted to ask you if you could code me an Indicator for unirenkos for Tradingview so I
Hello The EA will work on particular zone choose by the user and can mark it on any TF and with some rules can open trades and mange the trade by some unique rules. the EA need to check the difference by RSI as well and with some extra rules . developer should have good attitude and good communication (englsih) with high performence and knowledge with coding EA
Hello, I want to create an EA that can be able to take and optimise trade bids using the trend tracker concept I have developed. The tracker will monitor 2 lines to determine the trend of the market and afterwards take bids towards the correct direction. It will also be able to use a distance between the bids for the direction of the trend and plan a reverse bid when the price of the extreme doesn’t change again. The
Gradient boosting and L2 100 - 200 USD
I am looking for a well experienced programmer to put/implement a gradient boosting algorithm and an L2 to reduce overfitting in my ea which l already have which uses indicators . If you are experienced please adhere
Hello, I'm looking for a developer for repair calendar in EA MT4/MT5 (News Filter - https://ec.forexprostools.com ) for all windows servers. Note: EA MT4/MT5 works with calendar on PC Win 10, 11 but not on all windows servers. I have the source code and will post within the comments section for review. If you are able to do this and quality. Please apply. Thanks
Create mt4 ea 50+ USD
To convert the provided MT4 indicator script into an Expert Advisor (EA) and implement prompt functionality for user input, we need to modify the code to handle external parameters and provide a user-friendly interface. Below is the EA code that incorporates prompts for user inputs
SCALP MARTINCALE SPY TIMEFRAME 1MIN CANDLE - SHORT SIDE ONLY 1-SET RISK : A IS A VARIABLE (HOW MUCH $) 2-SET ATR(3) : SET THE TIME AT WHICH THE ATR SHOULD BE TAKEN, IF SET 933AM THEN THE ATR OF THE 1MIN CANDLE AT 933AM CANDLE WILL BE USED (ROUND AT 0.25 UP OR DOWN) *USE NEW YORK TIME 3-SET MAX NUMBER OF ENTRY : B IS A VARIABLE 4-SET RSI(14) / C IS A VARIABLE, IF RSI(14) > C = ORDERS OPEN 5-IF RSI(14) > C IS TRIGGERED

프로젝트 정보

예산
30+ USD
개발자에게
27 USD
기한
에서 1  2 일