One of the unique qualities of forex trading is that you are trading two currencies. A trade in a currency pair means that you are going long one currency and going short another. As prices fluctuate we can see which currency is performing stronger than another.

Take for example for the following popular currency pair EUR/USD on an hourly chart currently:

By looking at the chart we can see the Euro gaining strength against the US dollar in the most recent half-a-dozen bars (the bars on the right-most side of the chart). But the only way we know this is by seeing where the Euro has come from.

And this is the difficulty with performing strong and weak currency analysis - how far back is your look back period?

With our chart above the most recent bar (right-most bar) is a down candle, would you take this to mean that the US dollar is now stronger than the Euro? Or would you be comparing the current price to where it came from over the last 6 hours? In which case the Euro is stronger than the US dollar.

The look back period will be different for every individual forex trader as some traders will only be looking back over a smaller range of bars compared to those who look back over a longer range of bars.

So what are some ideas we could use to incorporate this analysis into our own trading?

## Strong & Weak Currency Analysis Ideas

Here are some ideas for how we could do our strong and weak analysis (remember, the base currency is the first currency in the currency symbol, whereas the quote currency is the other currency in the currency symbol, eg. EURUSD => EUR is base currency, USD is quote currency):

• Use price difference from X bars ago.
``````int look_back_period = 6; // comparing current price to x bars ago
double diff = Close - Close[x];
if (diff > 0) {
// base currency is strongest against the quote currency
} else {
// quote currency is strongest against the base currency
}
``````
• Instead of using raw price, use a moving average from X bars ago.
``````int ma_period = 20; // moving average period
int look_back_period = 6; // comparing current MA value to x bars ago
double ma_current = iMA(NULL, 0, ma_period, 0, MODE_EMA, PRICE_CLOSE, 0);
double ma_previous = iMA(NULL, 0, ma_period, 0, MODE_EMA, PRICE_CLOSE, look_back_period);
double diff = ma_current - ma_previous;
if (diff > 0) {
// base currency is strongest against quote currency
} else {
// quote currency is strongest against base currency
}
`````` We could use the popular RSI indicator to determine whether the base or quote currency is the strongest.
• Instead of using price or moving averages you could use your favourite indicator, such as the popular RSI. As moving averages are lagging indicators (they look back at historical price and plot themselves against price), you could use sentiment-type indicators (such as the RSI, Momentum, Stochastic, or MACD) which can show early if price is tending to reverse through a pattern known as divergence.
``````int rsi_period = 21; // RSI period
int look_back_period = 6;
double rsi_current = iRSI(NULL, 0, rsi_period, PRICE_CLOSE, 0);
double rsi_previous = iRSI(NULL, 0, rsi_period, PRICE_CLOSE, look_back_period);
double diff = rsi_current - rsi_period;
if (diff > 0) {
// base currency is strongest against quote currency
} else {
// quote currency is strongest against base currency
}
``````

Or you could just compare the RSI indicator to the mid-point level of 50%:

``````int rsi_period = 21; // RSI period
double rsi_level = 50; // level to compare against
double rsi_current = iRSI(NULL, 0, rsi_period, PRICE_CLOSE, 0);
double diff = rsi_current - rsi_level;
if (diff > 0) {
// base currency is strongest against quote currency
} else {
// quote currency is strongest against base currency
}
``````

Or to various levels within the RSI to ascertain how strong the base or quote currency is against the other:

``````int rsi_period = 21; // RSI period
double rsi_level_strong_base = 60; // greater than 60 base currency is strong
double rsi_level_overbought_base = 80; // greater than 80 base currency is too strong
double rsi_level_strong_quote = 40; // less than 40 quote currency is strong
double rsi_level_oversold_quote = 20; // less than 20 quote currency is too strong
double rsi_current = iRSI(NULL, 0, rsi_period, PRICE_CLOSE, 0);
if (rsi_current > rsi_level_overbought_base) {
// base currency is strong, but overbought
} else if (rsi_current > rsi_level_strong_base) {
// base currency is strong
} else if (rsi_current &lt; rsi_level_oversold_quote) {
// quote currency is strong, but oversold
} else if (rsi_current &lt; rsi_level_strong_quote) {
// quote currency is strong
} else {
// neither base or quote currency are showing any real dominance
}
``````
• Or instead of using price or indicators you could do a time comparison. We could compare which bar the highest and lowest price points formed and then compare which out of the two was closest to our current bar (nearest to bar = 0).
``````int look_back_period = 60;
int hi_bar = iHighest(NULL, 0, PRICE_CLOSE, look_back_period, 0);
int lo_bar = iLowest(NULL, 0, PRICE_CLOSE, look_back_period, 0);
if (lo_bar > hi_bar) {
// as the nearest bar is bar 0 and the furtherest bar would be 60,
// therefore, if hi_bar is further away than the lo_bar the
// base currency is stronger than the quote currency
} else if (hi_bar > lo_bar) {
// quote currency is stronger than the base currency
}
``````
• Or you could just use a combination of all the above to determine the strongest and weakest currency.

## How to Determine the Strongest Currency of All

Once we have chosen our method for determining how we are going to gauge how a currency is strong we will now create a function and run this through our list of currency pairs to see which currency is the strongest of all.

For the ease of following through I will use the first code snippet in our list above as our example function.

### Step #1 - Wrap our Method into a Function

We’ll start by wrapping our desired strong/weak currency script into a function is relatively easy:

``````/**
* Determines whether the currency of a symbol is strong.
* @example getStrong(30, "EURUSD", "EUR") => 1 (1 = is strong, -1 = is weak)
* @param look_back - number of bars to look back
* @param symbol - symbol of currency pair
* @param currency - string of currency to compare
* @param time_frame - time_frame to perform comparison, 0 is default
*/
int function isCurrencyStrong(int look_back, string symbol, string currency, int time_frame = 0) {
double diff = iClose(symbol, time_frame, 0) - iClose(symbol, time_frame, look_back);
// assumption here is that symbols are quoted without any divider
// eg. "EURUSD" not "EUR/USD"
base_currency = StringSubstr(symbol, 0, 3);
quote_currency = StringSubstr(symbol, 3, 3);
if (diff > 0) {
// base currency is strongest against the quote currency
if (base_currency == currency) return 1;
if (quote_currency == currency) return -1;
} else if (diff &lt; 0) {
// quote currency is strongest against the base currency
if (base_currency == currency) return -1;
if (quote_currency == currency) return 1;
}
return 0;
}
``````

### Step #2 - Send Currency Pairs to Function

Outside this function we create a list of all our currency symbols and iterate through that list passing each symbol through to determine what is the strongest, it could look something like this:

``````/**
* Calculate the strength of the current Symbol() by comparing it
* against other currency pairs.
* @param look_back - number of bars to look back
* @return int - 1 = go long; -1 = go short; 0 = do nothing
*/
int function getCurrencyStrength(int look_back) {
string base_currency = StringSubstr(Symbol(), 0, 3);
string quote_currency = StringSubstr(Symbol(), 3, 3);
int base_strength = 0;
int quote_strength = 0;
for (int i=0; i&lt;28; i+=1) {
string c = sym_list[i];
string base_sym = StringSubstr(c, 0, 3);
string quote_sym = StringSubstr(c, 0, 3);
// no need to loop through symbols that have none of our
// currency symbols.
if (base_currency == base_sym || base_currency == quote_sym ) {
base_strength += isCurrencyStrong(look_back, c, base_currency, 0);
}
if (quote_currency == base_sym || quote_currency == quote_sym) {
quote_strength += isCurrencyStrong(look_back, c, quote_currency, 0);
}
}
// Now it's just a matter of what you want to be able to do with
// our variables. A score of 7 for either the base_strength or the
// quote_strength variables, in the method's used case, would
// denote the base currency is the strongest.
// Whereas a score of -7 for either would denote they are the
// weakest currency.
// Using +5/-5 in both cases should denote strength/weakness
// enough to go long/short.
if (base_strength >= 5 && quote_strength &lt;= -5) return 1;
if (base_strength &lt;= -5 && quote_strength >= 5) return -1;
return 0;
}
``````

As explained in the comments section above, as we progress through this function we loop through all the symbols contained within our symbol list to then pass each symbol through to our function which we wrote in the first step.

Once we have iterated through each of our symbols our `base_strength` and `quote_strength` variables should contain a value no greater than +7 and no less than -7.

Our final decision is then what would be enough for these variables to signal a buy or sell action? In our example, I’ve wanted the `base_strength` variable to be greater than or equal to `+5` and its subsequent variable `quote_strength` to be less than or equal to `-5`… and vice versa.

## Conclusion

To determine the strongest and weakest currency of all you would need more than just a simple metric of what their current price is. You would want to know where price has come from - relative to itself.

By being consistent with our method in determining strength we can then use this metric to best determine whether a currency we are considering trading is to be weak or strong.

With our example MQL4 functions we have used a simple method to determine strength and can add the output of this function in our second step to our entry gate process to see if entry is possible.