Master MetaTrader 5 with TradingBoxing: Your Ultimate EA Solution

Mike 2018.06.18 22:58 24 0 0
Attachments

Hey there, fellow traders! If you’re diving into the world of MetaTrader 5, you’ve probably heard about TradingBoxing. While our latest version is inspired by it, we’ve taken a fresh approach, utilizing MQL5 and incorporating some cutting-edge trading classes.

So, what’s the deal with our trading panel? It’s straightforward! There’s just one input parameter you need to keep an eye on: the magic number. This unique identifier is essential for your EA to function smoothly.

Check out the layout of our trading panel below:

TradingBoxing

To make sure you have a clear view of your trade volumes, we’ve made a slight tweak to the standard class CSpinEdit, renaming it to CSpinEditDouble. We ran into a bit of a hiccup trying to create it through inheritance since we needed to adjust some class members that were marked as “private.”

As the name suggests, this class is designed to handle double-type data seamlessly. We’ve also introduced the DisplayedDigits method, which defines how accurately the text will be displayed in the control.

And guess what? The text field is now editable! This feature comes in handy when you need to input a price or volume that’s quite different from what’s currently shown. To ensure the text from this field is saved as a value, we’ve added the EndEdit method to the CSpinEditDouble class:

   int               m_digits;              // displayed digits
   //---
   void              EndEdit() { Value(StringToDouble(Text())); }

public:
                     CSpinEditDouble(void);

This method ensures that any text you enter gets stored as a value.


Now, the EndEdit method is triggered from the OnEvent class CSpinEditDouble:

//+------------------------------------------------------------------+
//| Common handler of 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)

For the quickest order processing, even in a sluggish market where ticks come in slowly, every click on the trading panel button will force an internal handler call: CTradingBoxingDialog::OnTick(). This ensures you're always ready to seize the moment!

List
Comments 0