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

 
Alexey Viktorov:

To avoid straining those trying to help, me in particular, it's better to put the post 'in your pocket' and paste it instead of linking to it.

Thanks for the advice. I've never used a pocket and therefore don't really understand what it is, although I see a link to it all the time. If you know where on this forum info about the pocket and if it's not difficult for you, please give me a link to it.
Thank you.

 
ANDREY:

Thanks for the tip. I've never used a pocket and therefore don't really understand what it is, although I see a link to it all the time. If you know where on this forum the info about the pocket is and if you don't mind, please give me a link to it.
Thank you.

Where it says "reply", there's a "pocket". And when you write a post there's a green icon that looks like the back pocket of a pair of jeans. You press it and you're in the pocket.

 
Alexey Viktorov:

Where it says 'reply', there's also an 'in pocket'. And when you write a message, there's a green icon that looks like the back pocket of a pair of jeans. It's clicked and you're in the dumps.

Thanks for the new information. Got it and learned how to use the pocket. This is progress....

 
Alexey Viktorov:

The beginning is so far away that it's hard to answer in detail... But I'll try to be clever...

If I remember correctly, you have to determine when the Low of the candle was formed on which the order was opened. When this candlestick is current, it is no problem: we put the smaller of the two numbers into the variable and do this until the candlestick closes. But if we need to determine it when this candle is already the 10th, then it is already a problem for mql4. It's very easy to do it in mql5, just copy "from and to" the selected time ticks, and the array will contain everything you need. But for mql4, you have been suggested to write the ticks to a file, so that later you may get these ticks and use this array to determine if the Low of that candle is lower than the minimum value in the array, it means that Low was before the order was opened. If they are equal, it means that Low was formed after the order was opened.

However... if the EA works, it is enough to determine it in a variable, as it's described here; there is a function for this purpose that can be found in documentation in section "Mathematical functions".

I realized long ago that mql5 has much wider possibilities than mql4. Can mql5 do the following

Using the above functions, you can find a price minimum between any number of BARs
. Does mql5 have functions (functions) that allow finding a price minimum not between BARs but between TICKS (tick prices), for example, within a minute candle?

I'm interested in built-in functions that do everything quickly and unobtrusively, not in linguistic constructions with loops, saving into a file, into a variable, into an array .... and other hassles.

If there are no such functions in mql5, may mql5 find the minimum between ticks much faster than mql4? If so, how to do it?
Thank you.

 
ANDREY:

I realized a long time ago that mql5 has much wider possibilities than mql4. Can mql5 do the following

Using the above functions, you may find price minima between any number of BARs
. Does mql5 have functions (functions) that allow you to find price minima not between BARs but between TICKS (tick prices), like inside a minute candle?

I'm interested in built-in functions that do everything quickly and unobtrusively, not in linguistic constructions with loops, saving into a file, into a variable, into an array .... and other hassles.

If there are no such functions in mql5, may mql5 find the minimum between ticks much faster than mql4? If so, how to do it?
Thank you.

Where you have seen iLow(), there is

int  CopyTicksRange( 
   const string     symbol_name,           // имя символа 
   MqlTick&         ticks_array[],         // массив для приёма тиков 
   uint             flags=COPY_TICKS_ALL,  // флаг, определяющий тип получаемых тиков 
   ulong            from_msc=0,            // дата, начиная с которой запрашиваются тики 
   ulong            to_msc=0               // дата, по которую запрашиваются тики 
   );
why not read up on it¿¿¿ But finding the minimum value only through a loop.
 
Afternoon!
Can you please tell me how I can transfer my balance from MetaTrader 4 to a MetaTrader 5 account and start trading on it?
My first experience with quotes went in the red.
 
Rustam1611:
Hi!
Can you please tell me how I can transfer my balance from MetaTrader 4 to a MetaTrader 5 account and start trading on it?
My first experience with quotes went in the red.

Go to your personal cabinet at your broker and open an mt5 account - in the same cabinet transfer funds from that account (mt4) to the account (mt5)

 
Alexey Viktorov:

Where you looked at iLow(), there is a nearby

Why not read about it? But finding the minimum value only through a loop.

For an array, searching for highs and lows seems to have been around for a long time. Just not for multidimensional ones.

ArrayMaximum

Search for an element with the maximum value

ArrayMinimum

Search for an element with the minimum value

ArrayMaximum - Операции с массивами - Справочник MQL4
ArrayMaximum - Операции с массивами - Справочник MQL4
  • docs.mql4.com
ArrayMaximum - Операции с массивами - Справочник MQL4
 
Valeriy Yastremskiy:

For an array, searching for maxima of minima seems to have been around for a long time. Just not for multidimensional ones.

ArrayMaximum

Search for an element with the maximum value

ArrayMinimum

Search for an element with the minimum value

And certainly not for an array of structures.

 

Colleagues - understand the question is elementary - may have had updates in the terminal - forgot.

I wrote a script - I load it from under scripts - it all flies into execution at once.... and opens a market position.

How do I mark external variables, that will let me select them (change values) before execution, like in Expert Advisor?


#property copyright "Copyright © 2021, ROMANBEST"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict


input int      Magic=326;
//input int      TralingStep=10;
extern   string   Simbol = "";             // Simbol ()
extern   int      operation = 0;               // OP_BUY. OP_SELL
extern   double   Lot = 1;    // период первого ATR



//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   double sl, tp;
   OpenPosition(Simbol, operation, Lot, sl=0, tp=0, Magic);
   return(0);
  }
//+------------------------------------------------------------------+

For example, in Expert Advisor (as usual)



Reason: