We need to specify the right comment when sending a request from OrderSend(). Here is an example of how to do this using the CTrade class
//+------------------------------------------------------------------+ //|AddCommentToPosition.mq5 | //| Copyright 2011, MetaQuotes Software Corp. | | //|http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2011, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property version "1.00" #property script_show_inputs #include <Trade/Trade.mqh> //--- input parameters input string comment="From the script."; //+------------------------------------------------------------------+ //| Script programme start function| //+------------------------------------------------------------------+ void OnStart() { //--- CTrade trade; trade.Buy(0.1,_Symbol,0,0,0,comment); } //+------------------------------------------------------------------+
Result:
Thank you. I understand that this is the code when writing a new Expert Advisor, or can it be inserted into any existing Expert Advisors by copying this code? I am interested in -to insert it into Expert Advisors that are already in the database, for example, this one: Moving Averages.mq5
Dear all, good morning!
I tried to use the algorithm to trade on MT5 on the Brazilian Stock Exchange, and it has no movement. When I debugged the algorithm, it showed consistency errors in lines 34,35,36 and 51 of the auxiliary file "SignalCandles.mqh". - Please be so kind as to point out how to correct these errors, or edit the corrected auxiliary file.
Paulo,
The programmes are made for forex, which has several peculiarities that are not compatible with the B3 or BMF.
If you still have doubts, I suggest this article to start programming in mql5: https://www.mql5.com/en/articles/100.
With a few adaptations, you can run it on the B3 and BMF, which in practice would be a simplification, as many forex parameters are unnecessary, such as margin calculation, volume checking, order expiry time, leverage, etc.
Abs,
Luciano

- www.mql5.com
MQL5 Wizard - Trade Signals Based on Reversal Candlestick Patterns:
Author: MetaQuotes Software Corp.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
MQL5 Wizard - Trade Signals Based on Reversal Candlestick Patterns:
MQL5 Wizard provides the automatic creation of Expert Advisors (see MQL5 Wizard: Creating Expert Advisors without Programming).
The CSignalCandles class provides trade signals, based on reversal candlestick patterns. The strategy called "Signals based on reversal candlestick patterns" (when creating EA automatically in MQL5 Wizard).
The idea of the system is to indentify the reversal patterns using the calculation of the composite candle. The reversal patterns is similar to the "Hammer" and ">Hanging Man" patterns in Japanese candlestick analysis. But it uses the composite candle instead the single candle and doesn't need the small body of the composite candle to confirm the reversal.
Author: MetaQuotes Software Corp.