Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 433

 

how to make a new trade not to open on the bar where the last one closed ?

or just advise how to get the closing time of the last order that was executed

 
Zver4991:

how to make a new trade not to open on the bar where the last one closed ?

or just advise how to get the closing time of the last order that was executed

About the time of the last order, a possible example, the principle is: select the required order (the last), look at its characteristics (closing time)

for (int j=OrdersTotal()-1; j>=0; j--)
{
if (!OrderSelect(j,SELECT_BY_POS,MODE_HISTORY) ) break;
fbuy=OrderCloseTime();

}

In general, you'd better learn how to work with search instead of programming - everything is there... Who did google do the revolution for... it's infuriating...

 
mikhail12:

About the time of the last order, a possible example, the principle is: select the desired order (the last), look at its characteristics (closing time)

for (int j=OrdersTotal()-1; j>=0; j--)
{
if (!OrderSelect(j,SELECT_BY_POS,MODE_HISTORY) ) break;
fbuy=OrderCloseTime();

}

In general, you'd better learn how to work with search instead of programming... Who did google do the revolution for... it just pisses me off...

And not even google, everything is on the website

This function returns the closing bar number of the last position

taken from this thread

 
Please give me the formula to calculate the value of the indicator for the bar that just closed. If it is not difficult in mathematical form (I know that it redraws, but I am interested in calculation of the current value, which is reflected in real time). Thanks in advance
Files:
tma.mq4  9 kb
 

Good afternoon!

Can you please tell me how to return an array from a custom function, let's say a two-dimensional array? Or it's not foreseen? And it is necessary to use the array declared at a global level? Thanks in advance!

Example:

int start()

{

int x,y;

double Mass[][];

Mass=FindPrices(x,y); ----- this does not work - compile error....

}

double FindPrices(int i, int j)

{

double Mass_2[][];

.... calculations.....

return( Mass_2);

}

 
_Pushok_:

Good afternoon!

Can you please tell me how to return an array from a custom function, let's say a two-dimensional array? Or it's not foreseen? And it is necessary to use the array declared at a global level? Thanks in advance!

Example:

int start()

{

int x,y;

double Mass[][];

Mass=FindPrices(x,y); ----- this does not work - compile error....

}

double FindPrices(int i, int j)

{

double Mass_2[][];

.... calculations.....

return( Mass_2);

}

You can do it like this:

void fSoftFractals(int i                           // Текущий бар
                  ,int iLastB,int iLastT           // Бары предыдущих фракталов
                  ,double& B[],double& T[]         // Буферные массивы фракталов
                  ,int Left=1,int Right=1){        // Размерность фракталов
 
tara:

You can go like this:


I don't get it??? So is it possible to return an array or not?

Got it )) https://docs.mql4.com/ru/basis/variables/formal

Thank you!

 
Experts, how do you replace Sleep() in the tester?
 

EventSetTimer and OnTimer in new builds.

 
evillive:

EventSetTimer and OnTimer in new builds.

So it will only give a possibility to perform some action by time, not by tick, as I understand it, and I need an owl to sleep in tester after condition to put...