MetaTrader 4 Build 600 with Updated MQL4 Language and Market of Applications Released - page 59

 
Folex:

Installed Build 613 and encountering some issues reading csv files which are separated by semicolons. Comma versions do not have this issue.

I use the below code as example. For the comma version i just replace the semicolon with a comma within the FileOpen function.

The problem with the semicolon version is that the pointer moves straight to the file end after the second FileReadString. Thus the delimeter/seperator appears not to be recognized. Is there a new way of declaration?

All worked fine on 509, 604, 610. Only Build 613 is having issues / compiled versions on 509/604/610 which worked prior do not work on Build 613


Can you provide a sample data file ?
 
angevoyageur:

Can you provide a sample data file ?


I have attached a csv for testing. Just a plain standard csv separated by semicolon.

1;1;1

2;2;2

3;3;3

etc

 
Folex:

Installed Build 613 and encountering some issues reading csv files


Bug has already been reported. https://forum.mql4.com/61399/page2#916932
 

Hi,

I've been using this indicator which I found with the help of google for quite some time (I can't remember exactly where).

This indicator shows the total cumulative of pips for all open orders and working wonderfully until irresponsible updates of MT4 by MQ causing the indicator no longer working properly and now showing wrong result.

Can anybody please take a look and make the indicator working again. I tried to change the code here and there, but nothing works, maybe because simply I don't know what are the error exactly.

Appreciate all help on this. It will be beneficial for everybody I believed.

thanks.

//+------------------------------------------------------------------+
//|                                             totalpipsdisplay.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//+------------------------------------------------------------------+

#property indicator_chart_window
#define  NL    "\n"
extern int    WhatCorner = 3;
extern int    x_1_axis = 70;
extern int    y_1_axis = 223;
extern int    x_2_axis = 10;
extern int    y_2_axis = 223;
extern int    FontSize = 18;
extern string FontType = "Arial Bold";
extern color  FontColorUp  =  Lime;
extern color  FontColorDown  =  Red;
extern color  FontColorZero  =  Silver;
color FontColor;
double PipsProfit;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 
   ObjectDelete("Total_Pips1");
   ObjectCreate("Total_Pips1", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Total_Pips1", OBJPROP_CORNER, WhatCorner);
   ObjectSet("Total_Pips1", OBJPROP_XDISTANCE, x_1_axis);
   ObjectSet("Total_Pips1", OBJPROP_YDISTANCE, y_1_axis);
   
   ObjectDelete("Total_Pips2");
   ObjectCreate("Total_Pips2", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Total_Pips2", OBJPROP_CORNER, WhatCorner);
   ObjectSet("Total_Pips2", OBJPROP_XDISTANCE, x_2_axis);
   ObjectSet("Total_Pips2", OBJPROP_YDISTANCE, y_2_axis);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
  ObjectDelete("Total_Pips1");
  ObjectDelete("Total_Pips2");
   return(0);
  }
//+------------------------------------------------------------------+
  double CalculatePipsProfit()
   {
    double Profit=0;
    double multiplier;
    for (int cc=0; cc<OrdersTotal(); cc++)
      {
       OrderSelect(cc,SELECT_BY_POS,MODE_TRADES);
       int ERR=GetLastError();
       if(ERR!=0) Print("Error selecting trade ", ERR);
       if (OrderType()==OP_BUY) double ThisTradeProfit = MarketInfo(OrderSymbol(),MODE_BID) - OrderOpenPrice();
       if (OrderType()==OP_SELL) ThisTradeProfit = OrderOpenPrice() - MarketInfo(OrderSymbol(),MODE_ASK);
       if (MarketInfo(OrderSymbol(),MODE_DIGITS)==5) multiplier = 10000;
       if (MarketInfo(OrderSymbol(),MODE_DIGITS)==4) multiplier = 10000;
       if (MarketInfo(OrderSymbol(),MODE_DIGITS)==3) multiplier = 100;
       if (MarketInfo(OrderSymbol(),MODE_DIGITS)==2) multiplier = 100;
       ThisTradeProfit = ThisTradeProfit * multiplier;
       Profit = Profit + ThisTradeProfit;
      }
    return(Profit);
   }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int counted_bars = IndicatorCounted();
   if (OrdersTotal()==0) {PipsProfit = 0.0;} else {PipsProfit = CalculatePipsProfit();}
       string Market_Price = '';
       Market_Price = StringConcatenate(" ", DoubleToStr (PipsProfit, 1));
       if (PipsProfit > 0) FontColor = FontColorUp;
       if (PipsProfit < 0) FontColor = FontColorDown;
       if (PipsProfit ==0) FontColor = FontColorZero;
       ObjectSetText("Total_Pips1", "Total Pips : ", FontSize, FontType, FontColor);
       ObjectSetText("Total_Pips2",  Market_Price, FontSize, FontType, FontColor);
   return(0);
  }
//+------------------------------------------------------------------+
 
popo: indicator no longer working properly and now showing wrong result. simply I don't know what are the error exactly.
  1. And neither do we. "wrong result" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
  2. GetLastError no longer clears the error. Don't call it unless you have an error.
    OrderSelect(cc,SELECT_BY_POS,MODE_TRADES);
    int ERR=GetLastError();
    if(ERR!=0) Print("Error selecting trade ", ERR);
    
    What are Function return values ? How do I use them ? - MQL4 forum
    if( !OrderSelect(cc,SELECT_BY_POS,MODE_TRADES) ){
       int ERR=GetLastError();
       Print("Error selecting trade ", ERR);
    } else {

 
WHRoeder:
  1. And neither do we. "wrong result" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
  2. GetLastError no longer clears the error. Don't call it unless you have an error.
    What are Function return values ? How do I use them ? - MQL4 forum

WHRoeder,

the "wrong result" I'm trying to say is the indicator now no longer shows the correct actual total pips for all open orders. for example, if the actual total pips for all open orders is 22.4 pips, the result shown by the indicator is now in range of 100k++ pips.

previously before the MT4 were force to be updated to built 600++, the indicator is showing the correct total pips, but now I can't even tell how the indicator comes up with the numbers.

 

Is code profiler a pending feature or is it supposed to be working now ?

 
SDC:

Is code profiler a pending feature or is it supposed to be working now ?

The profiler has been working since the very beginning, build 529.
 
angevoyageur:
You can't, it's now done automatically.

ok but i have two mt4s with different brokers with different versions and i haven't updated them manual. one with built 600 and one with built 610. it looks surely that the one with the build 600 wasn't updated yet. cause the update history where can i find it?
 
investor89:

ok but i have two mt4s with different brokers with different versions and i haven't updated them manual. one with built 600 and one with built 610. it looks surely that the one with the build 600 wasn't updated yet. cause the update history where can i find it?
It's in the log (Journal tab) or log files.
Reason: