How I assemble my advisor by trial and error - page 39

 
Aleksandr Klapatyuk:

open the metaiditor

open the top line (files), there is (open data directory)

это адрес C:\Users\---------\AppData\Roaming\MetaQuotes\Terminal\36A64B8C79A6163D85E6173B54096685

you need to go to

and delete this MetaQuotes folder.

warning !!!---all the indicators you installed and the experts will be deleted.

this will work - you have to restart the terminal

 

#property version "1.03"

I won't change anything -version "1.03" is the normal version

I added a superfluous function toversion "1.04".

---------------------------------------------------------------------------------

if anyone is interested, here is a fully functional version https://c.mql5.com/3/297/Horse_move__4.mq5

1.03

 

How easy it is to learn how to manage -

place an object with a name on the chart ( for example, a horizontal line) this line has a name - copy it

open the Expert Advisor settings and fill it in - if the line is set above the current price, you need to put it where ( TOP ) if it is below the current price, then ( LOWER )

further we choose a command - what we want these lines to do (

//+------------------------------------------------------------------+
//| Enum TRADE_COMMAND                                               |
//+------------------------------------------------------------------+
enum ENUM_TRADE_COMMAND
  {
   close_buys=0,     // Close All Buy's
   close_sells=1,    // Close All Sell's
   close_all=2,      // Close All Buy's and Sell's
   open_buy=3,       // Open Buy
   open_sell=4,      // Open Sell
   open_buy_sell=5,  // Open Buy and Sell
  };

)

 
Aleksandr Klapatyuk:

#property version "1.03"

I won't change anything -version "1.03" is the normal version

I added a superfluous function toversion "1.04".

---------------------------------------------------------------------------------

if anyone is interested, here is a fully functional version https://c.mql5.com/3/297/Horse_move__4.mq5

Hello Alexander, the version 1.03 is the one you cited on the link https://c.mql5.com/3/297/Horse_move__4.mq5 in the code of your Expert Advisor.

So is it the third version or did you just forget to change it to 1.04?

Sincerely, Vladimir.

 
MrBrooklin:

Hello Alexander, the link you provided https://c.mql5.com/3/297/Horse_move__4.mq5 has version 1.03 in the EA code.

So is it the third version or did you just forget to change it to 1.04?

Regards, Vladimir.

It is the third version.

as it is, the fourth version is also working - the function I have added is not needed. it does not prevent the Expert Advisor from working, but it is of no use.

 

If you press key four (V) or key Russian (M) on your computer, three horizontal lines will pop up.

Do not enter names in Expert Advisor of these horizontal lines.

Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
При создании графического объекта функцией ObjectCreate() необходимо указать тип создаваемого объекта, который может принимать одно из значений перечисления ENUM_OBJECT. Дальнейшие уточнения свойств созданного объекта возможно с помощью функций по работе с графическими объектами.
 

I will now tell you how to use a variant, from a line triggered opening, another line at a different distance .

input string   t3="------ Obj:Name 1-2-3-4 ------";     // Имя Объекта
input string   InpObjUpNameZ           = "TOP 1";       // Obj: TOP (Name Obj) ВВЕРХУ 1
input string   InpObjDownNameZ         = "LOWER 2";     // Obj: LOWER (Name Obj) ВНИЗУ 2
input int      Step                    = 15;            // Obj: Шаг сетки, пунктов(0 = false)
input string   InpObjDownName0         = "TOP 3";       // Obj: TOP (Name Obj) ВВЕРХУ 3
input ENUM_TRADE_COMMAND InpTradeCommand=open_sell;     // Obj:  command:
input string   InpObjUpName0           = "LOWER 4";     // Obj: LOWER (Name Obj) ВНИЗУ 4
input ENUM_TRADE_COMMAND InpTradeCommand0=open_buy;     // Obj:  command:

1,2 - this is the name for those objects that will - not to open positions, but to open another object at a given distance ( Step=15;// Obj: Step of the grid, points(0 = false))

will open 3,4 - from these objects - you set a command (=open_buy;// Obj: command:)

Совершение сделок - Торговые операции - Справка по MetaTrader 5
Совершение сделок - Торговые операции - Справка по MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
 

there is another option

input string   t5="- 2_Obj:Trailing Line 7-8-9-10 --- ";// Trailing Obj:Line
input string   InpObjUpNameZx          = "TOP 7";       // Obj: TOP (Name Obj) ВВЕРХУ 7
input string   InpObjDownNameZx        = "LOWER 8";     // Obj: LOWER (Name Obj) ВНИЗУ 8
input int      StepZx                  = 15;            // Obj: Шаг сетки, пунктов(0 = false)
input string   InpObjUpNameX           = "TOP 9";       // Obj: TOP (Horizontal Line) ВВЕРХУ 9
input ENUM_TRADE_COMMAND InpTradeCommandX=open_buy;     // Obj:  command:
input string   InpObjDownNameX         = "LOWER 10";    // Obj: LOWER (Horizontal Line) ВНИЗУ 10
input ENUM_TRADE_COMMAND InpTradeCommand0X=open_sell;   // Obj:  command:
input ushort   InpObjTrailingStopX     = 15;            // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStepX     = 5;             // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)

this is the same as the other option - only these objects can also work as a trawl

 

also if you have popped out - two objects

is adjusted with the

input int      Step                    = 15;            // Obj: Шаг сетки, пунктов(0 = false)


input int      StepZx                  = 15;            // Obj: Шаг сетки, пунктов(0 = false)
0 - nothing will pop up
 
Aleksandr Klapatyuk:

there is another option

it is the same as that variant - only these objects can also work as trawl

input string   InpObjUpNameX           = "TOP 9";       // Obj: TOP (Horizontal Line) ВВЕРХУ 9
input ENUM_TRADE_COMMAND InpTradeCommandX=open_buy;     // Obj:  command:
input string   InpObjDownNameX         = "LOWER 10";    // Obj: LOWER (Horizontal Line) ВНИЗУ 10
input ENUM_TRADE_COMMAND InpTradeCommand0X=open_sell;   // Obj:  command:
input ushort   InpObjTrailingStopX     = 15;            // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStepX     = 5;             // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)

onlyTOP (Horizontal Line)LOWER (Horizontal Line) is suitable for trail names.

Important!!! Horizontal lines

input string   t5="- 2_Obj:Trailing Line 7-8-9-10 --- ";// Trailing Obj:Line
input string   InpObjUpNameZx          = "TOP 7";       // Obj: TOP (Name Obj) ВВЕРХУ 7
input string   InpObjDownNameZx        = "LOWER 8";     // Obj: LOWER (Name Obj) ВНИЗУ 8
it does not matter - as long as the name of theObj object is entered: TOP (Name Obj) UP 7
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
При создании графического объекта функцией ObjectCreate() необходимо указать тип создаваемого объекта, который может принимать одно из значений перечисления ENUM_OBJECT. Дальнейшие уточнения свойств созданного объекта возможно с помощью функций по работе с графическими объектами.
Reason: