Questions from Beginners MQL5 MT5 MetaTrader 5 - page 18

 
RedFish:
Can you elaborate on that? Sorry I don't understand the answer.

Look in the help.

And into ready examples of MACD and MovingAverage

 

Good afternoon.

Could you tell me how to solve the following problem in MQL5:

If there are two variables datetime date1, date2.

The task is to get the number of milliseconds passed between date1 and date2.

Thank you all!

 
gyvenor:

Good afternoon.

Could you tell me how to solve the following problem in MQL5:

If there are two variables datetime date1, date2.

The task is to get the number of milliseconds elapsed between date1 and date2.

Use GetTickCount() which just counts milliseconds.
Документация по MQL5: Общие функции / GetTickCount
Документация по MQL5: Общие функции / GetTickCount
  • www.mql5.com
Общие функции / GetTickCount - Документация по MQL5
 
Renat:
To calculate the number of milliseconds, use GetTickCount() that just counts milliseconds.

There is a note in the function description:"The counter is limited by the resolution of the system timer. As the time is stored as an unsigned integer, it overflows every 49.7 days during continuous computer operation."

1.) Does the counter reset after the overflow?

2.) I want to get this figure to count the number of bars since the signal. Perhaps there is an alternative way to get the number of bars between two events?

P.S.

As a newbie on this forum, I don't know how to say thanks here. I don't see any thank you buttons, it is probably not very nice to spam a separate post :).

 
gyvenor:

Good afternoon.

Could you tell me how to solve the following problem in MQL5:

If there are two variables datetime date1, date2.

The task is to get the number of milliseconds elapsed between date1 and date2.

Thank you all!

(date2-date1) will give the time difference to within a second.

 

Hello.

The trade server is working inMarket Execution mode.I want touse the OrderSend function toplace a pending order of theORDER_TYPE_SELL_STOPtype.When filling out the standard structure of a trade request, the value of the stoplimit field causes problems. Sincethe order type is neitherORDER_TYPE_BUY_STOP_LIMIT norORDER_TYPE_SELL_STOP_LIMIT, I actually need this field. But the documentation says that 11 fields are required (and you can add a magik). So I'm confused. Should I not specify this field in the structure at all ormust I specify something? If I chooseORDER_TIME_GTC in thetype_time field,may I ignore it?

Thank you in advance.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
Does anyone have a ready-made cat toincrease a lot when fixing a loss. I really need it, please help me get rich)))
 
Top2n:
Do anyone have a ready-made cat, to increase thelot when fixing a loss? I don't know how to cook it (I don't know how to cook it))) I don't know how to cook it.

"Increasing the lot while fixing the loss" doesn't sound very creative,

But "I'll give you the program for a modest fee" is just the thing :)

SZZ This is where you go, is martin so bad? Or do you need to know how to cook it?

There is someone to ask and someone to consult.

 
Urain:

"Increasing the lot while fixing the loss" doesn't sound very creative,

But "I'll give you the program for a modest fee" is just the thing :)

SZZ This is where you go, is martin so bad? Or do you have to know how to make it?

There's someone there to ask and someone to consult with.

Thanks, it will be interesting to read!)
 

Colleagues, help me to get JJMA indicator values correctly in Expert. I don't want to call via iCustom, because it is very resource-intensive.

Anyway, the file SmoothAlgorithms.mqh has everything I need, I need to get the values of the last 2 bars in an Expert Advisor in the loop: zero and the first one.

Here is the function:

double CJJMA::JJMASeries(uint begin,            // Номер начала достоверного отсчета баров
                         uint prev_calculated,  // Количество истории в барах на предыдущем тике
                         uint rates_total,      // Количество истории в барах на текущем тике
                         int  Din,              // разрешение изменять параметры Length и Phase на каждом баре. 
                                                // 0 - запрет изменения параметров,  любое другое значение - разрешение.
                         double Phase,          // Параметр, изменяющийся в пределах -100 ... +100, влияет на качество переходного процесса усреднения
                         double Length,         // Глубина сглаживания
                         double series,         // Значение ценового ряда, раcсчитанное для бара с номером bar
                         uint bar,              // Номер бара
                         bool set               // Направление индексирования массивов
                        )
// JMASeries(begin, prev_calculated, rates_total, Din, Phase, Length, series, bar, set) 

How to spell it correctly in the EA ? what to put in prev_calculated and rates_total ? I do not have it right...

Thank you.

Reason: