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

 

the option of trawl and stop loss is a single function

input string   t2="------ Obj:Trailing Line     --- ";  // Trailing Obj:Line
input ushort   InpObjTrailingStop      = 0;             // Obj: Trailing Stop or Stop Loss (0 = false)
input ushort   InpObjTrailingStep      = 9;             // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)

if - 0 nothing will happen

or set the distance - then at position opening, horizontal line will be set and as the price moves away - the horizontal line will be pulled up behind the price

 

option - how to use an indicator for trawling

input string   t9="------ Auto trading ------";         // Авто Торговля от Индикатора
input bool     OpenedStop              = false;         // Вкл. Opened Buy/Sell
input bool     ClosedStop              = false;         // Вкл. Closed Buy/Sell
input bool     OpenedStopObj           = false;         // Вкл. Horizontal Line(true)
input bool     Revers                  = false;         // Indicator: Revers
//---

Choose an indicator and set (true) the default indicator #resource "\\Indicators\\\Examples\\ZigzagColor.ex5" here

input bool ClosedStop = false; // Closed Buy/Sell. Closed Buy/Sell

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

It is also possible to have a horizontal line at a given distance from the indicator without opening a position - with the following command

//+------------------------------------------------------------------+
//| 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
  };
//+------------------------------------------------------------------+
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
При создании графического объекта функцией ObjectCreate() необходимо указать тип создаваемого объекта, который может принимать одно из значений перечисления ENUM_OBJECT. Дальнейшие уточнения свойств созданного объекта возможно с помощью функций по работе с графическими объектами.
 
Explain clearly how to make money here
 
Дамир Сариев:
Clearly explain how to make money here

4. How to earn money at MQL5.community

You can increase your balance at MQL5.community website not only by depositing, but also by doing some work! Users of our resource can do this using the following services.

  • Freelance. If you are a programmer and feel yourself able to write in MQL5 on commission, you can find a job on a competitive basis in the appropriate section. A distinctive feature of the Freelance service is its security. The customer and the contractor are protected from unfair practices of the opposite side throughout their joint work, and if any disputes arise - the administration of the service is ready to act as an arbitrator.

  • Articles. You can publish articles on various topics related to MQL5 and automated trading systems on your own initiative. Articles fees start at 200 USD, and the final cost will depend on how your article will be of interest to community members, according to editors. You can find all the details in the Write and earn money on MQL5 topic in our forum.

  • Market. Here you can sell your own applications written in MQL4 and MQL5 to other MQL5.community members. The Market operates similarly to mobile application marketplaces. To be able to sell your application at the Market, you should register as a seller and post your application on the market.

  • Signals. Do you have a proven trading strategy? You can sell not an Expert Advisor itself, but trading signals that it generates. Thus, you can constantly adjust it to changing market, without disclosing all the subtleties.

  • MQL5 Cloud Network. Most of the processor time is wasted, but you can rent it for a small fee. All you need is to install remote tester agents and allow them to participate in the MQL5 Cloud Network. You can withdraw earned money or spend them in the Market, subscribe to Signals and place orders in Freelance.

Торговые приложения для MetaTrader 5 на заказ
Торговые приложения для MetaTrader 5 на заказ
  • www.mql5.com
Модификация индикатора Boa_ZigZag_Arrows_Duplex_HTF.mq5 1. Модификация индикатора ZigZag путем достройки линий,а так же с возможностью изменения таймфрейма индикатора во входных параметрах. 2. Проведение горизонтальных двух линий . ТЗ при согласовании. / может кто знает Nikolay Kositsin/ Добрый день , Ищу программиста который в кратчайшие...
 

It turns out you can use this function by pressing ( V ) - only these horizontal lines need to be renamed

so version 4 is fully functional

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Photo by

You can draw lines, rename them and pressthe (V) key once more to avoid unnecessary horizontal lines.

 

and so, I have now figured out how to use named objects myself.

You just need to name the objects with the names from the Expert Advisor TOP 1, LOWER 2, TOP 3, LOWER 4 and so on.

//+------------------------------------------------------------------+
//| 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
  };
//+------------------------------------------------------------------+
 

#property version "1.05"

no changes in the code itself

the default setting has changed a little

//+------------------------------------------------------------------+
input string   t0="------ Parameters --------";         // Настройка Эксперта
input string   Template                = "ADX";         // Имя шаблона(without '.tpl')
input datetime HoursFrom               = D'1970.01.01'; // Время старта Эксперта
input datetime HoursTo                 = D'2030.12.31'; // Время закрытия всех позиций
input double   TargetProfit            = 900000.00;     // Цель Баланса(Ваш Баланс + сумма)
input uint     maxLimits               = 1;             // Кол-во Позиции Открыть в одну сторону
input double   MaximumRisk             = 0.01;          // Maximum Risk in percentage
input double   DecreaseFactor          = 3;             // Descrease factor
input ENUM_LOT_OR_RISK InpLotOrRisk    = risk;          // Money management: Lot OR Risk
input string   t1="------ TakeProfit    ----------";    // TakeProfit
input double   InTakeProfit            = 54;            // Take Profit, ("0" -> нельзя,- будет закрывать)
input string   t2="------ Obj:Trailing Line     --- ";  // Trailing Obj:Line
input ushort   InpObjTrailingStop      = 0;             // Obj: Trailing Stop or Stop Loss ("0" -> false)
input ushort   InpObjTrailingStep      = 9;             // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)
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                    = 0;             // 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:
input string   t4="------ Obj:Name 5-6 ------";         // Имя Объекта
input string   InpObjDownName02        = "TOP 5";       // Obj: TOP (Name Obj) ВВЕРХУ 5
input ENUM_TRADE_COMMAND InpTradeCommand2=open_sell;    // Obj:  command:
input string   InpObjUpName02          = "LOWER 6";     // Obj: LOWER (Name Obj) ВНИЗУ 6
input ENUM_TRADE_COMMAND InpTradeCommand02=open_buy;    // Obj:  command:
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                  = 0;             // 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)
input string   t6="------ Obj: Revers Buy and Sell --"; // Obj: Revers Buy and Sell
input bool     ObjRevers               = false;         // Obj: Revers
input string   t7="------ Button: AVGiS -----";         // AVGiS (Или обычный режим Buy/Sell)
input ENUM_BUTTON Buttons              = Button0;       // Button: Вкл: Копки Buy/Sell
input bool     ObjectLineX             = false;         // Button: Horizontal Line(true) || Buy/Sell(false)
input int      TrailingStop_STOP_LEVEL = 36;            // Button: Trailing Stop LEVEL
input string   t8="------ Indicator Delete ------";     // Удалить Индикатор
input string   short_name              = "Indicator 1"; // INDICATOR_SHORTNAME 1
input string   short_name0             = "Indicator 2"; // INDICATOR_SHORTNAME 2
input bool     Inpres                  = false;         // Delete All Indicators
input string   t9="------ Auto trading ------";         // Авто Торговля от Индикатора
input bool     OpenedStop              = false;         // Вкл. Opened Buy/Sell
input bool     ClosedStop              = false;         // Вкл. Closed Buy/Sell
input bool     OpenedStopObj           = false;         // Вкл. Horizontal Line(true)
input bool     Revers                  = false;         // Indicator: Revers
//---
input double   TargetProfit            = 900000.00;     // Цель Баланса(Ваш Баланс + сумма)

here is your balance plus how much you want to earn. if the amount is less than your balance - expert will close the open position and exit

input double   InTakeProfit            = 54;            // Take Profit, ("0" -> нельзя,- будет закрывать)

it is also very important here - if it is 0 --- then the open position, will be closed immediately

Files:
Horse_move.mq5  246 kb
 

all the same - easy with these horizontal lines (which run from a computer key ( V ) or ( M ) Russian)

I press - raise and lower it to the necessary position, and then rename it if it is "LOWER 10" if it is "TOP 9" at the bottom

and then I press (V) or (M) Russian again - all unnecessary things will be removed, only the ones I have renamed will remain.

EURUSDH1

 

The result is not an Expert but a constructor

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

Example - when it reaches the green digits, it closes the position.

below, the red line follows the price and as soon as it touches it, it will go to sell

(not necessarily to the sell - any command - whatever you set).

EURUSDH1t

EURUSDH1

 

example

input uint     maxLimits               = 1;             // Кол-во Позиции Открыть в одну сторону
input double   MaximumRisk             = 0.01;          // Maximum Risk in percentage
input double   DecreaseFactor          = 3;             // Descrease factor
input ENUM_LOT_OR_RISK InpLotOrRisk    = lots;          // Money management: Lot OR Risk

for a normal lot - you can specify either - MaximumRisk = 0.03; // Maximum Risk in percentage

or maxLimits = 3; // Number of Positions to Open in one side

lot 3

Maybe I'm suffering from persecution - but the lot with the risk looked suspicious to me

here in the threadhttps://www.mql5.com/ru/forum/326509

Reason: