Bug in MQL5??

 

Hello Friends,


i use an expert for trading news.

now i wondering why this expert do not work correctly.

I normally use this EA to trade 2 currancies during news. For this i enter couple of parameter


input int Risiko=1;
input double Min_Lot=0.01;
input double Max_Lot= 20;

input int StopLoss=180;
input int TakeProfit=1200;

input int BreakEven=100;

input bool   use_Cur1=true;
input string Cur1="EURUSD";

input bool   use_Cur2=true;
input string Cur2="USDJPY";

input ENUM_ORDER_TYPE Richtung1=ORDER_TYPE_BUY;
input ENUM_ORDER_TYPE Richtung2=ORDER_TYPE_BUY;

now i found out, when i have this EA running, that the calculation of

_Digits

is wrong.


I normally place this expert on an default EURUSD chart.

As second i like to use USDJPY

here i get my problem in calculation, bcs i can't say, that the double _Point should use the _Digits from the currany not the one from the chart


it looks like

         if(Richtung1==ORDER_TYPE_BUY)
           {
            SL = NormalizeDouble(SymbolInfoDouble(Cur1,SYMBOL_ASK) - StopLoss *_Point,_Digits);
            TP = NormalizeDouble(SymbolInfoDouble(Cur1,SYMBOL_ASK) + TakeProfit * _Point,_Digits);
           
           }

         if(Richtung1==ORDER_TYPE_SELL)
           {
            SL = NormalizeDouble(SymbolInfoDouble(Cur1,SYMBOL_BID) + StopLoss *_Point,_Digits);
            TP = NormalizeDouble(SymbolInfoDouble(Cur1,SYMBOL_BID) - TakeProfit * _Point,_Digits);
           }


i have no idea hot to tell the SL and TP the _Digits from USDJPY when i run it on an EURUSD chart


any ideas? the idea is, to run it on 2 charts, but is this really needed?


amando

 

Predefined Variables they only apply to the current chart. You are looking at another chart. There for not a terminal bug but PICNIC

Get the values for the symbol in question. SymbolInfoInteger ENUM_SYMBOL_INFO_INTEGER SYMBOL_DIGITS and SymbolInfoDouble ENUM_SYMBOL_INFO_DOUBLE SYMBOL_POINT
Reason: