[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 752

 
Lim1:

How to simplify it

Maybe into an array

dooble  х[Balance][Lot_mod];
  for(Balance=600;Balance<1600;Balance+100)
  for(Lot_mod=0,1;Lot_mod<1;Lot_mod+0,1)
  {х[Balance][Lot_mod];}

Or into two one-dimensional arrays.

Then, knowing the balance, find the corresponding value.

 

Friends, could you suggest a mechanism to scale the price from here: https: //www.mql5.com/ru/code/7933

add it here (see attachment to this post)

So the rectangles from the second currency pair were formed correctly on the chart of the first currency pair?

(So that OverLay Chart would be inscribed in these rectangles)?

Files:
 
Abzasc:

Something like that, I guess.

SZY The "SRC" code insertion button is awkward to use, it's not easy to read.


It's not working only on the first (parameter from and to), but ignores the second.
 
cyclik33:

I can't get it to work, it only trades on the first (parameter from and to) and ignores the second.

The return was not removed after the first block.

You can try it like this

 if (UseHourTrade = True && !(Hour()>=FromHourTrade && Hour()<=ToHourTrade))
    {Comment("Time for trade has not come else! UseHourTrade");}
 else if(UseHourTrade2 = True && !(Hour()>=FromHourTrade2 && Hour()<=FromHourTrade2))
    {Comment("Time for trade has not come else! UseHourTrade2");}
 
and then only
 return(0);
 
Has anyone met the indicator to see the time of the bar opening in a low TF, not how much time is interesting, and to draw the marks on the chart where the bar started and where it ended
 
IgorM:
Has anyone met the indicator to see the time of the bar opening in a low TF, not how much time is interesting, and to draw the marks on the chart where the bar started and where it ended
Igor, this thread has recently discussed something similar. https://www.mql5.com/ru/forum/124660
 
ToLik_SRGV:
Igor, we discussed something similar in this thread. h ttps://www.mql5.com/ru/forum/124660


Not that, something like that:

 ObjectCreate("time_"+TimeToStr(Time[j],TIME_DATE|TIME_MINUTES),OBJ_VLINE,0,iTime(NULL,PERIOD_M15,i),0);

I want to draw bar times on M5 for M15, M30 and H1

I don't know how to start it :)

 

Please advise what the catch is:

1) I fill a two-dimensional array with the time of formation of the ZigZag extremum and the extremum value itself.

2) Filling the second array with ones or twos depending on whether the extremum corresponding to a given element is a local maximum or minimum.

3) I output the results through Alert.

but in a place where 1 or 2 should be printed zeros are always printed.

What's the catch?!?

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+


string TimeSave1[100][2], TimeSave2[100][2];

double A[], B[];

double Number_of_extremum[];

extern string Currency = "EURUSD";


+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

int counted_bars=IndicatorCounted();

//----

int k;

k=0;

double date;

int status;

for(int shift = 0; shift <= Bars-1; shift++)

{

date = iCustom(NULL, 0, "ZigZag", 12, 5, 3, 0, shift);

//----------------------------------------------------

if(date > 0)

{

TimeSave1[k][0]=TimeToStr(Time[shift]);

TimeSave1[k][1]=date;

k++;

}

}

//====================================================

for (int u=1;u<=k;u++)

{

if (StrToDouble(TimeSave1[u][1])<=StrToDouble(TimeSave1[u-1][1]))

{

Number_of_extremum[u]=1;// значит под номером u - нашли min

}

else

if (StrToDouble(TimeSave1[u][1])>=StrToDouble(TimeSave1[u-1][1]))

{

Number_of_extremum[u]=2;// значит под номером u - нашли max

}

}

//====================================================

for (int j=1;j<10;j++)

{

Alert("время== ",TimeSave1[j][0], " значение== ", TimeSave1[j][1], " max/min== ", Number_of_extremum[j]);

}

//----

return(0);

}

//+------------------------------------------------------------------+

And one more clarification:

how to compare dates and times in mql (for example, I need to determine which vertex of ZZ formed earlier - to do this I need to compare the time of their formation...)

 
IgorM:


Not that, something like that:

I want to draw bar times on M5 for M15, M30 and H1

I don't know how to start drawing :)

Igor, 1 bar H1 = M5*12 bars, 1 bar M30 = M5*6 bars, 1 bar M15 = M5*3 bars.
Can't you draw a rectangle around the right number of bars?