Experts: Crossing of two iMA - page 5

 
Vladimir Karputov:
Read again about netting and hedge and position. And so on several times until you understand.

I think I understand, if I close two at 0.1 there will be two spreads, and if I close one at 0.2 there will be one spread.

Thank you.

 
Shara1:

I think I understand, when closing two at 0.1 there will be two spreads, and when closing one at 0.2 there will be one spread.

Thank you.

I wrote a bit above about " In the settings there is the LOT SIZE of the OPEN position. It is not the TOTAL SIZE of theOPEN position(s)."
Совершение сделок - Торговые операции - MetaTrader 5
Совершение сделок - Торговые операции - MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
 
Vladimir Karputov:
I wrote a bit above about " In the settings it is the LOT SIZE of the OPEN position. This is not the TOTAL SIZE of theOPEN position(s)."

I asked why: in some Expert Advisors it seems to be in the description that only one position is opened, the second one is opened only after the first one is closed. In our case, we can open as many positions as we want, but close them all at once?

Thank you.

 
Shara1:

I was asking why: in some Expert Advisors it seems to be stated in the description that only one position is opened and the second one is opened only after the first one is closed. In our case, we can open as many positions as we want, but close them all at once?

Thank you.

In my code, everything is closed by Stop loss and Take profit. And it is opened according to the presence of a signal: if there is a BUY signal, then BUY will be opened, if there is a SELL signal, then SELL will be opened.

 
Vladimir, is there any way to limit the TOTAL SIZE OF OPEN POSITIONS in this Expert Advisor? Because it opened 8 positions and it is already obvious that the price will go the other way, but it still opens. And as a result, 5 positions were closed by trailing stop, with a minus.
Совершение сделок - Торговые операции - MetaTrader 5
Совершение сделок - Торговые операции - MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
 
Vladimir, it's me again. Now I have launched the updated EA with coloured indicators, but it doesn't work for some reason. It writes this error: MAFirst: Failed to create handle of the iMA indicator for the symbol EURUSD/PERIOD_M1, error code 4802. Please help me.
 
Shara1:
Vladimir, it's me again. Now I have launched the updated EA with coloured indicators, but it doesn't work for some reason. It writes this error: MAFirst: Failed to create handle of the iMA indicator for the symbol EURUSD/PERIOD_M1, error code 4802. Please help me.
You have something mixed up: the code Crossing of two iMAs is discussed in this thread and this code works on regular Moving Average (no "coloured" ones).
 
Vladimir Karputov:
You have something mixed up: this thread discusses the code Crossing of two iMAs and this code works on ordinary Moving Average (no "coloured" ones).

And here it is written: https://www.mql5.com/en/code/18440

Added: The iMA reference has been replaced with iCustom Custom Moving Average Input Colour. Now you can visually observe DIFFERENT coloured Moving Average indicators in the tester (in visual mode) or when you sketch the Expert Advisor on the chart:

I downloaded it and installed it.

But it does not start, it writes this: MAFirst: Failed to create handle of the iMA indicator for the symbol EURUSD/PERIOD_M1, error code 4802. Please help.

Crossing of two iMA
Crossing of two iMA
  • votes: 20
  • 2017.05.22
  • Vladimir Karputov
  • www.mql5.com
Обращение к iMA заменено на iCustom Custom Moving Average Input Color. Теперь в тестере (в визуальном режиме) или когда набросить эксперта на график можно визуально наблюдать РАЗНОЦВЕТНЫЕ индикаторы Moving Average: Пересечение двух (iMA, Moving Average), в качестве фильтра - третий индикатор (iMA, Moving Average). Расчет объема позиции (Lot...
 
Shara1:

And here it says: https://www.mql5.com/en/code/18440

Added: Address to iMA has been changed to iCustom Custom Moving Average Input Colour. Now in the tester (in visual mode) or when the Expert Advisor is sketched on the chart you can visually observe DIFFERENT coloured Moving Average indicators:

I downloaded it and installed it.

But it doesn't start, it writes this: MAFirst: Failed to create handle of the iMA indicator for the symbol EURUSD/PERIOD_M1, error code 4802. Please help me.

I apologise - my browser was giving me an old version for some reason.

Now about your error: look in the code description - it says that you need an indicator. Download it and place it in the Indicators folder.

Need an indicator

 
Vladimir Karputov:

I apologise - my browser was giving me the old version for some reason.

Now about your error: look in the code description - it says that you need an indicator. Download it and place it in the Indicators folder.


Thanks, I will try it tomorrow.