Good time to all. We need such a thing that will redraw the price chart from XXXUSD to USDXXX, ideally in a separate tab or indicator window.
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
godzilla
There is nothing easier!
komposter
This is not the same as what fxsaber suggested, as far as I understand.
unicornis
Make a Custom symbol in MT5 with the formula 1/(XXXUSD).
ronnetbox
thanks.. and how to turn it into a .mq4 file? I don’t understand programming)
fxsaber
Forum on trading, automated trading systems and testing of trading strategies
Libraries: Symbol
fxsaber, 2018.12.06 14:12
// Example of creating an inverted character
#include //
CUSTOMSYMBOL CustomSymb(StringSubstr(_Symbol, 3, 3) + StringSubstr(_Symbol, 0, 3) + StringSubstr(_Symbol, 6)); // You've created a symbol
double ReversePrice( const double Price )
{
return(Price ? NormalizeDouble(1 / Price, _Digits) : 0);
}
void ReverseTick( MqlTick &Tick )
{
Tick.bid = ReversePrice(Tick.bid);
Tick.ask = ReversePrice(Tick.ask);
Tick.last = ReversePrice(Tick.last);
}
bool ReverseTicks( MqlTick &Ticks[] )
{
for (int i = ArraySize(Ticks) - 1; i >= 0; i--)
ReverseTick(Ticks[i]);
return(true);
}
bool GetTicks( MqlTick &Ticks[] )
{
return(CopyTicks(_Symbol, Ticks) > 0);
}
void OnInit()
{
MqlTick Ticks[];
if (CustomSymb.IsCustom() && GetTicks(Ticks) && ReverseTicks(Ticks) &&
(CustomSymb.AddTicks(Ticks) > 0) && (CustomSymb.DataToSymbol() > 0) && CustomSymb.On())
ChartOpen(CustomSymb.Name, PERIOD_CURRENT); // Opened the chart
}
void OnTick()
{
MqlTick Tick[1];
if (CustomSymb.IsCustom() && SymbolInfoTick(_Symbol, Tick[0]) && ReverseTicks(Tick))
CustomTicksAdd(CustomSymb.Name, Tick);
}