Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 172

 
-Aleks-:

Obviously they do, but where is the data stored! I am importing quotes for another instrument - Si futures and I need to remove the zeros after the decimal point there, as they are not in Si.

Then let's start from the other side: how do you import?
 
YURAZ_CreateCSV_HistoryFile_From_MT5_For_MT4
YURAZ_CreateCSV_HistoryFile_From_MT5_For_MT4
  • votes: 28
  • 2010.12.15
  • Yuriy Zaytsev
  • www.mql5.com
Данный скрипт поможет получить для MetaTrader 4 полную историю без дырок из базы MetaTrader 5.
 
Victor Nikolaev:

It is enough to rework the script a bit

Which direction to rework - there are no zeros in the unloading.

Or, are you suggesting the other way round to split the integers?


 
Vitalie Postolache:
This way the script can be "corrected" so that the final file contains quotes in the right format, but whether the terminal will display them without the fractional part, I'm not sure. Most likely, there will be zeros after importing into the terminal. Ask the author of the script.

That's what I'm saying, there are zeros! Otherwise, everything works. And these zeros bother me - astronomical numbers in points spoil the perception.
 
-Aleks-:

Which direction to rework - there are no zeros in the unloading.

Or, do you propose to split the integers the other way round?


Then all that remains is to hide the chart prices and draw your own objects, but is it worth it? Why are zeros bothering you, is the aesthetics wrong?
 
Vitalie Postolache:
Then all that remains is to hide the chart prices and draw your own objects, but is it worth it? What do the zeros prevent from, the aesthetics are wrong?

Zeros prevent us from doing this because we have to reconfigure the EA globally in those places where points are used - it's a waste of time.
 
-Aleks-:

Zeros get in the way because you have to reconfigure the EA globally in places where points are used - it's a waste of time.
It's easier to switch to an A then :)
 
Vitalie Postolache:
It's easier to switch to a five then :)

It's easier for some and difficult for others - I have an EA of more than 15 lines, not counting 8 separate classes...
 

A little help for a newbie with the code:


There is code for locking trades:

MQL-code:
void OnTick(void){ double LB=0, LS=0; int b=0,s=0; for(int i=0; i<OrdersTotal(); i++){ if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){ if(OrderSymbol()==Symbol()){ int tip = OrderType(); 
           if (tip==OP_BUY){ LB += OrderLots(); b++; } if (tip==OP_SELL){ LS += OrderLots(); s++;
            }}}} Comment(b," Buy ",DoubleToStr(LB,2)," lot"," \n",s," Sell ",DoubleToStr(LS,2)," lot"); if (LS<LB){ if(OrderSend(Symbol(),OP_SELL,Lots,NormalizeDouble(Bid,Digits),100,0, stoploss, NULL,0,0,CLR_NONE)==-1) Print("Error ",GetLastError()," order opening
   } if (LS>LB){ if(OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask,Digits),100,0, takeprofit, NULL,0,0,CLR_NONE)==-1) Print("Error ",GetLastError()," order opening "); }
It works on the principle of locking each open trade...I.e., a trade is opened and it immediately covers it with the opposite one and so on to infinity...

I have to do it this way! When a deal was opened (or I myself kinda opened it), and if it was successful, it was safely closed... And if it was not justified, then after nth number (which can be specified in settings) tick opened the lock and held this position... I mean, logic is clear? If not, I'll try to explain the point in more detail...

Please help good people.... I will be very grateful