How can I set stop loss above/below the price action structure?

David Diez
2747
David Diez  
Ruben Ortega:

Hi, I´m making my own EA and I need to set my stop loss above the stucture for sells (view image) but I don´t know how to do  it.

Find the highest point through the last candles using iHighest, then set your SL at the desired distance above that level.

iHighest - Acceso a las series temporales y a los datos de indicadores - Manual de referencia de MQL5 - manual de usuario para el lenguaje del trading algorítmico/automático para MetaTrader 5

Documentación para MQL5: Acceso a las series temporales y a los datos de indicadores / iHighest
Documentación para MQL5: Acceso a las series temporales y a los datos de indicadores / iHighest
  • www.mql5.com
iHighest - Acceso a las series temporales y a los datos de indicadores - Manual de referencia de MQL5 - manual de usuario para el lenguaje del trading algorítmico/automático para MetaTrader 5
Carl Schreiber
Moderator
13700
Carl Schreiber  
Dokumentation zu MQL5: Konstanten, Enumerationen und Strukturen / Datenstrukturen / Struktur der Handelsanforderung
Dokumentation zu MQL5: Konstanten, Enumerationen und Strukturen / Datenstrukturen / Struktur der Handelsanforderung
  • www.mql5.com
Struktur der Handelsanforderung - Datenstrukturen - Konstanten, Enumerationen und Strukturen - Nachschlagewerk MQL5 - Nachschlagewerk über die Sprache des algothitmischen/automatischen Handels für MetaTrader 5
William Roeder
27515
William Roeder  
Ruben Ortega: I need to set my stop loss above the stucture for sells (view image) but I don´t know how to do  it.
  1. No image posted.
  2. Until you can state what you mean by “structure” in concrete terms (MA, fractal, highest, etc.) it can not be coded.
Ruben Ortega
38
Ruben Ortega  
William Roeder #:
  1. No image posted.
  2. Until you can state what you mean by “structure” in concrete terms (MA, fractal, highest, etc.) it can not be coded.
I want to set the stop loss above the structure (view image)
Files:
Ruben Ortega
38
Ruben Ortega  
Carl Schreiber #:
Look here for the examples: https://www.mql5.com/de/docs/constants/structures/mqltraderequest
I want to set the stop loss above the structure (view image)
Files:
Ruben Ortega
38
Ruben Ortega  
David Diez #:

Find the highest point through the last candles using iHighest, then set your SL at the desired distance above that level.

iHighest - Acceso a las series temporales y a los datos de indicadores - Manual de referencia de MQL5 - manual de usuario para el lenguaje del trading algorítmico/automático para MetaTrader 5

I want to set the stop loss above the structure (view image)
Files:
Carl Schreiber
Moderator
13700
Carl Schreiber  
Ruben Ortega #:
I want to set the stop loss above the structure (view image)

Use the ZigZag indicator. Open it (..\MQL5\Indicators\Examples\ZigZag.mq5) and look at the two buffers for high (and low).

Installed by you EA with iCustom() go back for the latest three highs (if HighMapBuffer[i] >_Point) and get the maximum of these three. Add some points if you'd like to.

Ruben Ortega
38
Ruben Ortega  
Carl Schreiber #:

Use the ZigZag indicator. Open it (..\MQL5\Indicators\Examples\ZigZag.mq5) and look at the two buffers for high (and low).

Installed by you EA with iCustom() go back for the latest three highs (if HighMapBuffer[i] >_Point) and get the maximum of these three. Add some points if you'd like to.

sorry but i dont know how to do it exactly, im a noob yet, can you explain me more detailed?
Vladimir Karputov
Moderator
302031
Ruben Ortega #:
sorry but i dont know how to do it exactly, im a noob yet, can you explain me more detailed?

An example of working with the ZigZag indicator

How to start with MQL5
How to start with MQL5
  • 2018.12.24
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
Ruben Ortega
38
Ruben Ortega  

The problem is that i dont know how to call to the high (nº1 view image) and put the stop there

Files: