FWIW, if considering the slope as well as the difference in the currencies then a further calculation would be needed. I still think the simple expression MathAbs (Cur1 - Cur2) will provide the solution to the first part, the beauty of MathAbs is that it doesn't matter which number is subtracted from which because it will always return a positive number, thus eliminating the need for any other code to determine which value is higher than the other.
The second part of determining slope is more complex and there's probably a few ways to do it, but what comes to mind would be using
1. an array to store the currency strength values (if not alredy), then
2. using something like
if ( Currency1slope[1] - Currency1slope[2] > Currency2slope[1] - Currency2slope[2] ) to compare values
of course further variables and code could be added to give other information depending upon what was trying to be achieved. But the basic idea is using an array to hold historical values then calculations can be made accordingly.
e.g.
Code: Select all
bool extrabuysignal () {
if (MathAbs (Currency1slope[1] - Currency2slope[1]) >= 0.6 && ( Currency1slope[1] - Currency1slope[2] > Currency2slope[1] - Currency2slope[2] ) )
return true;
else return false;
}
Again apologies if not helpful
Pips400