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

 

Example

To have a horizontal line (TOP 3 and LOWER 4) jump out at a specified distance when the button is pressed

set up here

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 int Step=0;// Obj: Grid step, points("0" -> false)

set the distance. nothing happens if there is zero

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

here(true)-it will display horizontal lines input bool ObjectLineX = false;// Button: Horizontal Line(true) || Buy/Sell(false)

BUTTONS

 
Aleksandr Klapatyuk:

Example

To have a horizontal line (TOP 3 and LOWER 4) jump out at a specified distance when the button is pressed

set up here

input int Step= 0; // Obj: Grid step, points("0" -> false)

set the distance. nothing happens if there is zero

here(true)-it will display horizontal lines input bool ObjectLineX = false; // Button: Horizontal Line(true) || Buy/Sell(false)

to open reverse positions from these lines

input string   t6="------ Obj: Revers Buy and Sell --"; // Obj: Revers Buy and Sell
input bool     ObjRevers               = false;         // Obj: Revers

set(true)

 

this is what I got from the buttons from the HORIZONTAL LINE - LOT 0.01

Result

 

example

work with the indicator - opens positions, both immediately and can be from horizontal lines

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
//---

to work from horizontal lines set(true)

input bool     OpenedStopObj           = false;         // Вкл. Horizontal Line(true)

and set step for horizontal lines(TOP 3 and LOWER 4) at given distanceinput intStep=0;// Obj: Grid step, points("0" -> false)

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:

in this function frominput string t9="------ Auto trading ------";// Auto Trade from Indicator

it turns out - two possibilities for reversing

if from horizontal lines - opened positions on the reverse

it can be changed here

input string   t6="------ Obj: Revers Buy and Sell --"; // Obj: Revers Buy and Sell
input bool     ObjRevers               = false;         // Obj: Revers

or another possibility

input bool     Revers                  = false;         // Indicator: Revers

the real position of the Expert Advisor on the opening - may be reversed with a few more possible ways.

The main thing is to learn how to do it on a demo account.

the way it works in the tester - you may as well try it in the tester.

from the indicator

 
Aleksandr Klapatyuk:

example

work with the indicator - opens positions, both immediately and can be from horizontal lines

to work from horizontal lines set(true)

and set step for horizontal lines(TOP 3 and LOWER 4) at given distance input intStep= 0; // Obj: Grid step, points("0" -> false)

in this function frominput string t9="------ Auto trading ------"; // Auto Trade from Indicator

it turns out - two possibilities for reversing

if from horizontal lines - opened positions on the reverse

it can be changed here

or another possibility

the real position of the Expert Advisor on the opening - may be reversed with a few more possible ways.

The main thing is to get a proficiency on a demo account.

the indicator may be a different way but it does not show how it works - you may as well try it in the tester.





it is possible to close positions with this function from the indicator - it is like a trawl

set here (true)

input bool     ClosedStop              = false;         // Вкл. Closed Buy/Sell
 

the indicator can be picked up - replaced in these places

#resource "\\Indicators\\Examples\\ZigzagColor.ex5"

and here

//+------------------------------------------------------------------+
//| Initialization of the indicators                                 |
//+------------------------------------------------------------------+
bool CSampleExpert::InitIndicators(void)
  {
//--- create MACD indicator
   if(m_handle_macd==INVALID_HANDLE)
      if((m_handle_macd=iCustom(m_symbol.Name(),Period(),"Examples\\ZigzagColor"))==INVALID_HANDLE)
        {
         printf("Error creating MACD indicator");
         return(false);
        }
//--- succeed
   return(true);
  }
//+------------------------------------------------------------------+

signal indicators are suitable - e.g. https://www.mql5.com/ru/code/395

by writing in the code

//---
#resource "\\Indicators\\BrainTrend2Sig.ex5"
//---

and here

//+------------------------------------------------------------------+
//| Initialization of the indicators                                 |
//+------------------------------------------------------------------+
bool CSampleExpert::InitIndicators(void)
  {
//--- create MACD indicator
   if(m_handle_macd==INVALID_HANDLE)
      if((m_handle_macd=iCustom(m_symbol.Name(),Period(),"BrainTrend2Sig"))==INVALID_HANDLE)
        {
         printf("Error creating MACD indicator");
         return(false);
        }
//--- succeed
   return(true);
  }
//+------------------------------------------------------------------+
BrainTrend2Sig
BrainTrend2Sig
  • www.mql5.com
BrainTrend2 BrainTrend2 представляет собой индикатор действующих на рынке трендовых тенденций, окрашивая свечи в зависимости от направления тренда. BrainTrend1Stop BrainTrend1Stop - это индикатор остановки тенденции, пересечение ценой линии стопов означает смену действующей на рынке тенденции и необходимость выхода из сделки...
 

Added Horizontal lines to this indicatorhttps://www.mql5.com/ru/code/24796

A kind of tool for working with Expert Advisor

here are names of objects - which can be connected to the Expert Advisor

input string   t4="------ Obj:Name     ------";     // Имя Объекта
input string   InpFont2              = "TOP";       // Obj: TOP (Obj:Name) ВВЕРХУ
input string   InpFont0              = "AVERAGE";   // Obj: LOWER (Obj:Name) СРЕДНЯЯ
input string   InpFont1              = "LOWER";     // Obj: LOWER (Obj:Name) ВНИЗУ
input bool     InpMove               = false;       // Obj: ObjectMove

AUDCADH1

BB TREND
BB TREND
  • www.mql5.com
Модификация стандартного индикатора Bollinger Bands - в качестве продолжения линий индикатора применяются трендовые линии OBJ_TREND. В качестве цены для расчётов используется цена закрытия Close. Трендовые линии строятся по двум точкам: левая задаётся через...
Files:
 

and also - the expert

should also work in windows on behalf of the object

Photo by

I have not tested it - I will check it on Monday. - but if it does not work - I will look for a way to add this function

I have just got an idea.

 

Good panel turns out - as an information and stop and trawl can be set by pressing the lower button and not releasing it - it turns into a trawl

BUTON

 

added to this indicatorhttps://www.mql5.com/ja/code/13910 Horizontal lines

Obj CCI_on StepChannel

to remove from the EA - you need to enter the indicator name

//---
   string short_name="Obj CCI_on StepChannel";
//---
   IndicatorSetString(INDICATOR_SHORTNAME,short_name);
//---
   return(INIT_SUCCEEDED);
  }
CCI on StepChannel (Volatility StepChannel 付)
CCI on StepChannel (Volatility StepChannel 付)
  • www.mql5.com
ステップチャネルを基準にCCIを表示します。「ボラティリティ・ステップチャネル」も付属しています。