Questions from Beginners MQL5 MT5 MetaTrader 5 - page 851

 
Artyom Trishkin:

Wouldn't it be better to make a simple Refresh() function, for example, with the required formal parameters, and call it when necessary?

And by the way, when you get rates_total in the indicator beyond OnCalculate() using Bars() with a date range, you can lead to freezing of the indicator:


And when refresh() is performed, will the indicator be recalculated by all bars?

 
khorosh:

Is Refresh() going to recalculate the indicator on all bars?

So... how do you make the function, that's how it will be...

 

In mcool5 I got the rsi buffer from the indicator, but how do I open a trade if rsi is above 70?

I mean how to open a deal - I know and how to get this current rsi value for comparison with the number 70 - I don't know.


All the instructions are here: https://www.mql5.com/ru/articles/43

Способы вызова индикаторов в MQL5
Способы вызова индикаторов в MQL5
  • 2010.03.09
  • KlimMalgin
  • www.mql5.com
В MQL5 существует несколько вариантов вызова индикаторов, и осуществляются они в основном при помощи функций IndicatorCreate() и iCustom(). Причем эти функции лишь возвращают хендл индикатора, и дальнейшая работа с индикаторами ведется именно через него. Так что же такое хендл? Как работать с функциями IndicatorCreate() и iCustom()? И как...
 
Askr:

In mcool5 I got the rsi buffer from the indicator, but how do I open a trade if rsi is above 70?

I mean how to open a deal - I know and how to get this current rsi value for comparison with the number 70 - I don't know.


All the instructions are here: https://www.mql5.com/ru/articles/43

Here is an example

RSI Eraser
RSI Eraser
  • votes: 16
  • 2017.11.20
  • Vladimir Karputov
  • www.mql5.com
RSI: averaging period - период усреднения индикатора RSI; Stop Loss - стоп лосс; Risk in percent for a deal from a free margin - процент риска от свободной маржи. Объем позиции рассчитывается в процентах от свободной маржи, Stop Loss устанавливается во входных параметрах. Условия на открытие BUY Вход на рынок на покупку, если индикатор RSI...
 
I have a question how to copy the price of an open trade. For example, I open a position and record date, levels, etc., and I do not want to write everything by hand, the date is copied, stop is copied, TP is also copied, but the price is not?
 
Seric29:
Guys, I am writing with a question how to copy the price of an open trade, for example, I open a position and record the date, levels, etc., etc., and I do not feel comfortable writing everything by hand, the date is copied, stop is copied, TP is also copied, but the price is not?

Show me your mql5 code, please.

 

How to calculate the lot size depending on the deposit size, and the expected series of losing trades, if the lot is multiplied by 2 after a losing trade.

Profit always equals loss, TP = 10, SL = 10. For example depo 6000 What lot to open first trade to survive 15 losing trades in a row?

Skipped maths.

 
lil_lil:

How to calculate the lot size depending on the deposit size, and the expected series of losing trades, if the lot is multiplied by 2 after a losing trade.

Profit always equals loss, TP = 10, SL = 10. For example depo 6000 What lot to open first trade to survive 15 losing trades in a row?

I missed maths.

Even the smallest lot would be too big.

 
Ivan Ivanov:

Even the smallest lot would be too big.

Well, 15 is for example, I'm interested in the formula for calculating the lot

 
lil_lil:

Well, 15 is for example, I'm interested in the formula for calculating the lot

You need the formula for the sum of the first N members of a geometric progression (search for it).

N - this is how many times in a row closing on the SL

The obtained amount is multiplied by the loss in currency from 1 SL with the minimum lot (0.01) - get the total loss after N losses for the case of the minimum lot.