My approach. The core is the engine. - page 75

 

Unicornis:.

...

Window of 10 checkboxes and a table of 12 rows|5 columns, first column and first row text value cells, other cells double(e.g. filling OHLC last 10 formed bars line by line).


Control code in the EA:

void OnTick()
  {
   E_Last_10_bars_Current_symbol(Symbol());
   E_Last_10_bars_Current_timeframe(Period());
   E_Last_10_bars_Last_price(Ask);
   //------------------------------------------------------------------
   E_Last_10_bars_1_Open_price(Open[1]);  E_Last_10_bars_1_Close_price(Close[1]);
   E_Last_10_bars_2_Open_price(Open[2]);  E_Last_10_bars_2_Close_price(Close[2]);
   E_Last_10_bars_3_Open_price(Open[3]);  E_Last_10_bars_3_Close_price(Close[3]);
   E_Last_10_bars_4_Open_price(Open[4]);  E_Last_10_bars_4_Close_price(Close[4]);
   E_Last_10_bars_5_Open_price(Open[5]);  E_Last_10_bars_5_Close_price(Close[5]);
   E_Last_10_bars_6_Open_price(Open[6]);  E_Last_10_bars_6_Close_price(Close[6]);
   E_Last_10_bars_7_Open_price(Open[7]);  E_Last_10_bars_7_Close_price(Close[7]);
   E_Last_10_bars_8_Open_price(Open[8]);  E_Last_10_bars_8_Close_price(Close[8]);
   E_Last_10_bars_9_Open_price(Open[9]);  E_Last_10_bars_9_Close_price(Close[9]);
   E_Last_10_bars_10_Open_price(Open[10]);E_Last_10_bars_10_Close_price(Close[10]);
   //------------------------------------------------------------------
   E_Last_10_bars_1_High_price(High[1]);  E_Last_10_bars_1_Low_price(Low[1]);
   E_Last_10_bars_2_High_price(High[2]);  E_Last_10_bars_2_Low_price(Low[2]);
   E_Last_10_bars_3_High_price(High[3]);  E_Last_10_bars_3_Low_price(Low[3]);
   E_Last_10_bars_4_High_price(High[4]);  E_Last_10_bars_4_Low_price(Low[4]);
   E_Last_10_bars_5_High_price(High[5]);  E_Last_10_bars_5_Low_price(Low[5]);
   E_Last_10_bars_6_High_price(High[6]);  E_Last_10_bars_6_Low_price(Low[6]);
   E_Last_10_bars_7_High_price(High[7]);  E_Last_10_bars_7_Low_price(Low[7]);
   E_Last_10_bars_8_High_price(High[8]);  E_Last_10_bars_8_Low_price(Low[8]);
   E_Last_10_bars_9_High_price(High[9]);  E_Last_10_bars_9_Low_price(Low[9]);
   E_Last_10_bars_10_High_price(High[10]);E_Last_10_bars_10_Low_price(Low[10]);
   //------------------------------------------------------------------   
   
  }

Code of the window in the markup language:

//-------------------------------------------------------------------------------------------------------------------- 
NEW_WINDOW,  W_NAME, "Last 10 bars",    W_TYPE, SETTINGS,   OOI,  W_ICON,1,
//====================================================================================================================
GROUP,A,

__, BOARD, "Symbol:",  EDIT, "Current symbol",  BOARD, "Timeframe:", EDIT, "Current timeframe", W,40, BOARD, "Price:", EDIT, "Last price", 

__, H_LINE,"HL1", W,410,

END_GROUP,
//------------------------------------
i, AT, _X2X, "MF", 10, _Y2Y,"MF", 10,
//-----------
i, X_GAP,10,

i,BOARDS, H,20, END,
//-----------
"Current timeframe",READ_ONLY,  
"Last price",       READ_ONLY, 
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------
//Объявляем таблицу:
//----------------------------------------------------------------------------------
GROUP,A, IS_TABLE,  


__,     T_HEADER, "Bar",     C_HEADER, "Open price", C_HEADER, "Close price",  C_HEADER, "High price", C_HEADER, "Low price",     

__,     R_HEADER, "1",  CELL, A,  CELL, A,   CELL, A,  CELL, A,         
__,     R_HEADER, "2",  CELL, A,  CELL, A,   CELL, A,  CELL, A,   
__,     R_HEADER, "3",  CELL, A,  CELL, A,   CELL, A,  CELL, A,     
__,     R_HEADER, "4",  CELL, A,  CELL, A,   CELL, A,  CELL, A,   
__,     R_HEADER, "5",  CELL, A,  CELL, A,   CELL, A,  CELL, A,         
__,     R_HEADER, "6",  CELL, A,  CELL, A,   CELL, A,  CELL, A,   
__,     R_HEADER, "7",  CELL, A,  CELL, A,   CELL, A,  CELL, A,     
__,     R_HEADER, "8",  CELL, A,  CELL, A,   CELL, A,  CELL, A,  
__,     R_HEADER, "9",  CELL, A,  CELL, A,   CELL, A,  CELL, A,         
__,     R_HEADER, "10", CELL, A,  CELL, A,   CELL, A,  CELL, A,   
 
END_GROUP,
//------------------------------------
i, AT, _X2X, "MF", 10, _Y2H,"HL1", 10,
//-----------
i, Y_GAP,-1,
i, X_GAP,-1,
//-----------
i,IS_ZEBRA_STYLE,
//----------------------------------------------------------------------------------
"Bar", W,30,
"Bar", H,30,
"Bar",N_COLOR,(int)C'235,235,0',
//----------------------------------
i,C_HEADERS,H,30,N_COLOR,(int)C'235,0,235', END,
i,R_HEADERS,H,30, N_COLOR,(int)C'0,235,0', END,
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------
GROUP,A,
 
__, V_LINE,"VL1", H,320,

END_GROUP,
//----------------------------------
i,AT,_X2W,"Low price", 10,  _Y2H,"HL1",10,
//----------------------------------
//----------------------------------------------------------------------------------
GROUP,A, 

__, CHECKBOX, "Checkbox 1",  
__, CHECKBOX, "Checkbox 2", 
__, CHECKBOX, "Checkbox 3",  
__, CHECKBOX, "Checkbox 4", 
__, CHECKBOX, "Checkbox 5",  
__, CHECKBOX, "Checkbox 6",  
__, CHECKBOX, "Checkbox 7", 
__, CHECKBOX, "Checkbox 8",  
__, CHECKBOX, "Checkbox 9",
__, CHECKBOX, "Checkbox 10",

END_GROUP,
//----------------------------------
i,AT,_X2W,"VL1",10,  _Y2H,"HL1",10,
//----------------------------------
i,Y_GAP,20,
i,X_GAP,20,
//----------------------------------

//====================================================================================================================
END_WINDOW,

First file - Expert Advisor.

The second file - install to the folder Incloud (do not change or open it).

The third file - install in the inlude folder and fill.

The fourth file - the engine. Upload it to the chart together with the Expert Advisor.

 

The table works. It can already be used now.

InExternal Connection.mqh file you need to prescribe what to do on events of pressing/rejecting checkboxes.

That's all.

 
Реter Konow:


The control code in the EA:

Window code in the markup language:

First file - EA.

Second file - install in the inlude folder (no need to change or open it).

The third file - install in the inlude folder and fill.

The fourth file - the engine. Attach it to the chart along with the Expert Advisor.

Thank you! I will try to add it.

 
Unicornis:

Thank you! I'll try and get it to work.

Ok. If you need to rename the checkboxes, write their names. Should be done in 5 minutes.

 
Реter Konow:


The control code in the EA:

Window code in the markup language:

First file - EA.

Second file - install in the inlude folder (no need to change or open it).

The third file - install to the inlude folder and fill.

The fourth file - the engine. Attach it to the chart together with the Expert Advisors.

First, do not put them into the folder "Include", but into the folder Include\DRIVE\.

Secondly, the files must be renamed from 'Connection_Properties.mqh' and 'External_Connection.mqh' to 'External Connection.mqh' and 'Connection Properties.mqh' (instead of the underscore put a space)

Third:

The third file is to install it in the inlude folder and fill it in.

What to fill in? Where to fill? Fill it with what?

Fourth, the panel doesn't appear after compiling and launching the Expert Advisor:


Fifth. If you guess to put this piece of code at the end of Extrenal Connection.mqh:

//----------------------------------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------------------------------------- 
NEW_WINDOW,  W_NAME, "Last 10 bars",    W_TYPE, SETTINGS,   OOI,  W_ICON,1,
//====================================================================================================================
GROUP,A,

__, BOARD, "Symbol:",  EDIT, "Current symbol",  BOARD, "Timeframe:", EDIT, "Current timeframe", W,40, BOARD, "Price:", EDIT, "Last price", 

__, H_LINE,"HL1", W,410,

END_GROUP,
...

There will be an error

'NEW_WINDOW' - declaration without type External Connection.mqh 265     1

i.e. this macro is not defined.

Peter, spare the time and feelings of your future users. You are posting code that doesn't work without additional manipulation. If you have no respect for your code, at least respect the time of other participants!

 
Vasiliy Sokolov:

Firstly, not in the 'inclusion folder' but in the Include\DRIVE\ folder.

Secondly, the files must be renamed from 'Connection_Properties.mqh' and 'External_Connection.mqh' to 'External Connection.mqh' and 'Connection Properties.mqh' (replace the underscore with a space)

Third:

What to fill in? Where to fill? Fill it with what?

Fourth, the panel doesn't appear after compiling and launching the Expert Advisor:


Fifth. If you guess to put this piece of code at the end of Extrenal Connection.mqh:

There will be an error

I.e. this macro is not defined.

Peter, spare the time and feelings of your future users. You are posting code that doesn't work without additional manipulation. If you disrespect your code, at least respect the time of other participants!

Vasily, why write nonsense?

Is it just trolling?

There's already a space in the file name.

Fill - means to prescribe calls of your functions on checkboxes event.

You need to put the EA on the chart, and then the engine.

The files must be saved exactly in the folder inluded.

You do not have to put anything anywhere. This is a selftest.

 
People, be serious - I'm sick and tired of having to delete your rubbish. If you want to revive the smoking room, we can send you to the wash - you can get high there.
 
Vasiliy Sokolov:


The given markup language window code is just an example of its composition. It does not need to be placed anywhere. It is already in the engine.

Filling:

OpenExtrenal Connection.mqhfileand set your function calls on control events.

 
Реter Konow:

Save the files exactly in the inclusion folder.

Peter, I'm about to start swearing at you in a bad way. Here's the code you posted:

//+------------------------------------------------------------------+
//|                                                 TestApp v1.0.mq4 |
//|                                                      Peter Konow |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Peter Konow"
//+------------------------------------------------------------------+
#include<DRIVE\Connection  Properties.mqh>
#include<DRIVE\External  Connection.mqh> 
//---------------------------------------
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   //------------------------------------  
   EventSetMillisecondTimer(225);
   //------------------------------------
   EventChartCustom(0,INIT_GUI,0,0,NULL);  
   //------------------------------------ 
   return(INIT_SUCCEEDED);
  } 
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   EventChartCustom(0,DEST_GUI,0,0,""); 
//--- destroy timer
   EventKillTimer();
     
  }

Look what's highlighted in yellow. Okay?

Konow reg:

There's already a space in the file names.

Peter, download the files you posted and see what they're called. Just for the sake of interest.

Anyway, after compiling the panel I don't see it. Not at all. That's how the window looks like:

p.s. This is not trolling.

 
Vasiliy Sokolov:

Peter, I'm about to start cursing at you in a bad way. Here's the code you posted:

Look what's highlighted in yellow. Okay?

Peter, download the files you posted and see what they're called. Just for the sake of interest.

In any case, after compilation the panel doesn't show up for me. Not at all. That's how the window looks like:

p.s. This is not trolling.

I have a space in the name of the files. Why they are downloaded with a "_" I don't know.

1. The files'External Connection.mqh' and 'Connection Properties.mqh' should be in the inclusion folder.

2. The EA file is in the Expert folder. It should be opened, compiled, and saved.

3. The engine should be saved in the indicators folder.

4. Run the engine and the Expert Advisor on the chart. That is all.

I apologize:

#include<DRIVE\Connection  Properties.mqh>
#include<DRIVE\External  Connection.mqh> 

Indeed. I forgot to remove the connection through theDRIVE folder in the EA

This needs to be fixed.