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

 
WORLD FRIEND Heat June)))))
 
Alexsandr San:

Draft buttons, may be useful to someone for mt4

I think I have it all hooked up. Can be in the tester and on the real

//---
input string   t10="----------- Time ------------------";
input datetime HoursFrom        = D'1970.01.01'; // Закрыть всё
input string   t="------------- Balans Parameters -----";
input double   TargetProfit     = 999999.99;     // Баланс + Прибыль(прибавить к балансу)
input double   TargetLoss       = 0;             // Баланс - Убыток(отнять от баланса)
input string   _Orders_="------ Parameters Order ------";
input double   Lots             = 0.01;          // Lots
input int      StopLoss         = 10000;         // StopLoss
input int      TakeProfit       = 10000;         // TakeProfit
input double   TrailingStop     = 300;           // TrailingStop Фиксированный размер трала
input double   TrailingStep     = 50;            // TrailingStep Шаг трала
//---

TimeBalansClose

Files:
 
Alexsandr San:

I think I've wired everything up. You can do it in the tester and in real life

added a horizontal line opens position and reverse to the same

the vertical one closes everything

//---
input string   t10="----------- Time ------------------";
input datetime HoursFrom        = D'1970.01.01'; // Закрыть всё
input string   t="------------- Balans Parameters -----";
input double   TargetProfit     = 999999.99;     // Баланс + Прибыль(прибавить к балансу)
input double   TargetLoss       = 0;             // Баланс - Убыток(отнять от баланса)
input string   _Orders_="------ Parameters Order ------";
input double   Lots             = 0.01;          // Lots
input int      StopLoss         = 10000;         // StopLoss
input int      TakeProfit       = 10000;         // TakeProfit
input double   TrailingStop     = 300;           // TrailingStop Фиксированный размер трала
input double   TrailingStep     = 50;            // TrailingStep Шаг трала
input string   R_Orders_="----- Revers H Line ---------";
input bool     ReversOrders     = false;         // Revers Horizontal Line
//---

HLinTimeBalansClose

line buttons need to be pressed, as drawn

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

this is for the tester - to work properly check when the market opens

Files:
 
Alexsandr San:

added from horizontal lines opens positions and reverses to the same

from the vertical line closes everything


line buttons must be pressed, as drawn

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

this is for the tester - to work normally I need to check when the market opens

interesting utility for mt4

settings

//---
input string   t10="----------- Time ------------------"; //
input datetime HoursFrom        = D'1970.01.01'; // Закрыть всё
input string   t="------------- Balans Parameters -----"; //
input double   TargetProfit     = 999999.99;     // Баланс + Прибыль(прибавить к балансу)
input double   TargetLoss       = 0;             // Баланс - Убыток(отнять от баланса)
input string   t2="------------ Exchange TP SL --------"; //
input double   InpTProfit       = 1000;          // Exchange TP
input double   InpStopLoss      = 1000000;       // Exchange SL
input string   t0="------------ Lots Parameters -------"; //
input double   InpLots1         = 0.01;          // : Lots 1
input int      InpLots_01       = 200;           // Exchange Lots
input double   InpLots2         = 0.02;          // : Lots 2
input int      InpLots_02       = 400;           // Exchange Lots
input double   InpLots3         = 0.04;          // : Lots 3
input int      InpLots_03       = 800;           // Exchange Lots
input double   InpLots4         = 0.08;          // : Lots 4
input string   _Orders_="------ Parameters Order ------"; //
input int      StopLoss         = 10000;         // StopLoss
input int      TakeProfit       = 10000;         // TakeProfit
input double   TrailingStop     = 300;           // TrailingStop Фиксированный размер трала
input double   TrailingStep     = 50;            // TrailingStep Шаг трала
input string   R_Orders_="----- Revers H Line ---------"; //
input bool     ReversOrders     = false;         // Revers Horizontal Line
//---
Files:
 
Alexsandr San:

Interesting utility for mt4

settings

I will test it and report how it works

 
Сергей Дыбленко:

When I test it, I will let you know how it goes.

this tool is more interesting, the horizontal line is a kind of pending order, and yes, reverse do not forget, it's like a reversal of poles from buy to sell

there's also this function

input string   t2="------------ Exchange TP SL --------"; //
input double   InpTProfit       = 1000;          // Exchange TP
input double   InpStopLoss      = 1000000;       // Exchange SL

for example in sell, there may be minus points but the total amount will be closed.

here is the function with lot

input string   t0="------------ Lots Parameters -------"; //
input double   InpLots1         = 0.01;          // : Lots 1
input int      InpLots_01       = 200;           // Exchange Lots
input double   InpLots2         = 0.02;          // : Lots 2
input int      InpLots_02       = 400;           // Exchange Lots
input double   InpLots3         = 0.04;          // : Lots 3
input int      InpLots_03       = 800;           // Exchange Lots
input double   InpLots4         = 0.08;          // : Lots 4

when a position is in deficit above the total - the next position will be opened with a bigger lot

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

all functions work in the strategy tester - in the strategy tester

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

here is an example everything was going in minus but lot was increasing from loss and(InpTProfit = 10;// Exchange TP) put 10, as total amount became +10 all positions were closed.

If they were open another way, they wouldn't close until they hit +10

Photo by

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

you can use with many pairs - by time all positions will close by removing pending orders and by total profits

and from the vertical line will delete everything

Snapshot3

 
Alexsandr San:

Interesting utility for mt4

settings

#property version "1.01"

Fixed the opening of the lot

input string   t0="------------ Lots Parameters -------"; //
input double   InpLots          = 0.01;          // Lots
input double   InpLots1         = 0.02;          // : Lots 1
input int      InpLots_01       = 200;           // Exchange Lots
input double   InpLots2         = 0.04;          // : Lots 2
input int      InpLots_02       = 400;           // Exchange Lots
input double   InpLots3         = 0.08;          // : Lots 3
input int      InpLots_03       = 800;           // Exchange Lots
input double   InpLots4         = 0.16;          // : Lots 4
Files:
 
Alexsandr San:

#property version "1.031"

Sort of corrected the calculation from

#property version "1.032"

Corrected the opening of the Lot

input string   t0="-----  Lots Parameters   -----";              //
input uint     maxLimits                    = 1;                 // Кол-во Позиции Открыть в одну сторону
input double   InpLots                      = 0.01;              // Lots
input double   InpLots1                     = 0.02;              // : Lots 1
input int      InpLots_01                   = 200;               // Exchange Lots >< Point Lots
input double   InpLots2                     = 0.04;              // : Lots 2
input int      InpLots_02                   = 400;               // Exchange Lots >< Point Lots
input double   InpLots3                     = 0.08;              // : Lots 3
input int      InpLots_03                   = 800;               // Exchange Lots >< Point Lots
input double   InpLots4                     = 0.16;              // : Lots 4
Files:
 
Alexsandr San:

I made an Expert Advisor on mt4 out of nothing to do

for this type of Indicatorshttps://www.mql5.com/ru/code/8772

This is one of modes

There is a usual mode - open close

Slightly reworked for better

I am not attaching the indicator - you need to choose to your taste


Files:
 
Semaphore Line
Semaphore Line
  • www.mql5.com
или от Горизонтальной линии установить трал.(линии срабатывают от касания)
Reason: