different point() for multi currency

 
hi im trying to code a multi symbol expert and i'm almost done but i have a problem on converting points to place trades but when i try combining 5 digit currency and 3 digits currency. the 3 digit currency always place the stoploss at the wrong place. but when i trade them on separate backtest they run smoothly. any thoughts on what's the error?
void ProcessTradeOpen(int SymbolLoop, string TradeDirection)
   {
      string CurrentSymbol = SymbolArray[SymbolLoop];
      
      double AskPrice=NormalizeDouble(SymbolInfoDouble(CurrentSymbol, SYMBOL_ASK), Digits);   
      double BidPrice=NormalizeDouble(SymbolInfoDouble(CurrentSymbol, SYMBOL_BID), Digits);
      double Points  =_Point;
      
      double StopLoss             = (int)(Atr[1] * InpATRMultiplierSL / Point);//StopLoss Condition
      double TakeProfit           = StopLoss;//TakeProfit Condition
      double TrailingStopStart    = TakeProfit*1.2;//Trailing Stop Start Condition
      double TrailingStopStep     = (int)(Atr[1] * InpATRMultiplierTLSS / Point);//Traling Stop Step Condition
      
      NormalizeStopLoss[SymbolLoop]           =StopLoss;   
      NormalizeTakeProfit[SymbolLoop]         =TakeProfit;
      NormalizeTrailingStopStart[SymbolLoop]  =TrailingStopStart;
      NormalizeTrailingStopStep[SymbolLoop]   =TrailingStopStep;
      
      //INSERT YOUR PRE-CHECKS HERE
      if(TradeDirection=="LONG"){
         bool success= OrderSend(CurrentSymbol,OP_BUY,calculateLotSize(SymbolLoop),AskPrice,3,BidPrice-NormalizeStopLoss[SymbolLoop]*Points,0,InpTradeComment,InpMagicNumber);
         Orderlots(SymbolLoop);
         
      }else
      if(TradeDirection=="SHORT"){
         bool success=  OrderSend(CurrentSymbol,OP_SELL,calculateLotSize(SymbolLoop),BidPrice,3,AskPrice+NormalizeStopLoss[SymbolLoop]*Points,0,InpTradeComment,InpMagicNumber);
         Orderlots(SymbolLoop);
      }          
      
   }
Testing trading strategies on real ticks
Testing trading strategies on real ticks
  • www.mql5.com
The article provides the results of testing a simple trading strategy in three modes: "1 minute OHLC", "Every tick" and "Every tick based on real ticks" using actual historical data.
 
  1. Perhaps you should read the manual. Point is the current chart's symbol. Get the value for the currency you want.
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  2. I recommend: Do not trade multiple currencies in one EA.

    1. You can't use any {MT4: predefined variables, MT5: predefined variables,}

    2. Must poll (not OnTick, unless you use specific indicators)
                The Implementation of a Multi-currency Mode in MetaTrader 5 - MQL5 Articles (2011)

    3. and usually other problems, e.g. A problem with iBarShift - MQL4 programming forum - Page 2

    4. You must handle History {MT4:4066/4073 errors: Download history in MQL4 EA - MQL4 programming forum, MT5: Timeseries and Indicators Access /  Data Access - Reference on algorithmic/automated trading language for MetaTrader 5.}

    5. Code it to trade the chart pair only. Look at the others if you must. Don't assume that Time[i] == iTime(otherPair, TF, i) always use iBarShift.

    Then put it on other charts to trade the other pairs. Done.
 
William Roeder #:
  1. Perhaps you should read the manual. Point is the current chart's symbol. Get the value for the currency you want.
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  2. I recommend: Do not trade multiple currencies in one EA.

    1. You can't use any {MT4: predefined variables, MT5: predefined variables,}

    2. Must poll (not OnTick, unless you use specific indicators)
                The Implementation of a Multi-currency Mode in MetaTrader 5 - MQL5 Articles (2011)

    3. and usually other problems, e.g. A problem with iBarShift - MQL4 programming forum - Page 2

    4. You must handle History {MT4:4066/4073 errors: Download history in MQL4 EA - MQL4 programming forum, MT5: Timeseries and Indicators Access /  Data Access - Reference on algorithmic/automated trading language for MetaTrader 5.}

    5. Code it to trade the chart pair only. Look at the others if you must. Don't assume that Time[i] == iTime(otherPair, TF, i) always use iBarShift.

    Then put it on other charts to trade the other pairs. Done.

hi William, this EA is on mt5, I'm using mql4 OLS library on mql5 so I can implement my code easily but I don't know how this thread got into this section maybe a mistake.

i tested this EA on EURUSD/EURGBP which is 5 digit currency it work fine and both trade normally but when I switched to different currency that is 3 digits EURUSD/USDJPY

the EURUSD works fine but the USDJPY keeps placing wrong STOPLOSS level. i tried changing some commands and reading both mql4 and mql5 reference to find what really

cause the problem but i still don't know. thanks for the reply earlier

Files:
usd.png  3 kb