Extend CTrade or CSignal only for comment/color?

 

In MQL4, OrderSend() has a color parameter (see https://docs.mql4.com/trading/ordersend).

Since I'm using MQL5 with the CExpert class, I added the standard CTrade class to the CExpert instance.

CTrade has an OrderOpen() function, which unfortunately doesn't have a color property. However, it does have a comment property (which is then displayed on the chart next to the candlestick?) when an order has been opened (https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradeorderopen).

In the standard implementation of CTrade::OrderOpen, however, the comment parameter is an empty string and cannot be set on constructor level. Since CExpert calls CTrade when orders are placed, the comments are empty, and no visual cues are displayed on the chart by default.

Now, my questions:

1. Is the above conclusion correct that no visual cues for entry and exit signals are displayed on the chart by default?

2. If so, what is the best way to handle this? Should I extend the CTrade class and override the comment parameter so that it is displayed on the entry or exit candlestick in the chart automatically? Or should I use the CSignal class, which provides these visual cues?

OrderSend - Trade Functions - MQL4 Reference
OrderSend - Trade Functions - MQL4 Reference
  • docs.mql4.com
OrderSend - Trade Functions - MQL4 Reference
 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 

Unlike MQL4, in MQL5 you have no control over the "graphics" that are generated.

Also, on MetaTrader 5 the trade functionality is totally different, which also affects how Order Comments are handled.

Articles

Orders, Positions and Deals in MetaTrader 5

MetaQuotes, 2011.02.01 16:13

Creating a robust trading robot cannot be done without an understanding of the mechanisms of the MetaTrader 5 trading system. The client terminal receives the information about the positions, orders, and deals from the trading server. To handle this data properly using the MQL5, it's necessary to have a good understanding of the interaction between the MQL5-program and the client terminal.