Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

TradingBoxing - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 3 reads | 0 comments |

TradingBoxing - expert for MetaTrader 5

While developing it, we were inspired by codetrading boxing . However, the code below is only based on ideas, and absolutely all implementations are made in MQL5 and new trading classes.

The trading panel has only one input parameter, the magic number - the unique identifier of the EA.

Trading panel appearance:

TradingBoxing - expert for MetaTrader 5

Displays trading volumes (open positions and pending orders), standard category CSpinEdit slightly modified and saved as CSpinEditDouble . Unfortunately, we can't create it using inheritance because we have to change the class members declared as "private".

As can be seen from the class name, it was created to display double precision data. Therefore, we added the method Display Numbers - to define the precision of text display in the control.

The text fields in this control are also editable. For example, it can be helpful when you have to enter a price or quantity that differs significantly from the value in the text field. To save the text in a text field as a value, the method End Edit has been added to the CSpinEditDouble class:

 Integer m_digits; //Number displayed //---
Blank end edit() { value( string to double (text())); }

people :
                    CSpinEditDouble( blank );

This method stores the entered text as a value.

The method to end editing is called from the OnEvent class of CSpinEditDouble :

 //+------------------------------------------------------------------+
//|Generic handler for chart events |
//+------------------------------------------------------------------+ EVENT_MAP_BEGIN(CSpinEditDouble)
  ON_EVENT(ON_CLICK,m_inc,OnClickInc)
  ON_EVENT(ON_CLICK,m_dec,OnClickDec) ON_EVENT(ON_END_EDIT,m_edit,EndEdit) EVENT_MAP_END (CWndContainer)

In order to process trading orders as quickly as possible (even in very quiet markets with long tick intervals), every click on the trading panel button forces a call to the internal handler CTradingBoxingDialog::OnTick().


Attachment download

📎tradingboxingdialog.mqh (78.89 KB)

📎 spineditdouble.mqh (10.81 KB)

📎 tradingboxing.mq5 (4.98 KB)

Source: MQL5 #20860

Verification code Refresh