Suppress print out from CTrade Sell and Buy functions

 

Hey hey!

is it possible to suppress the print Outs from the CTrade sell and buy functions?

Here is my code:

m_trade.Sell(0.1,_Symbol,last_tick.ask,last_tick.ask+SL,last_tick.ask-TP

This produces the following print out in back tester's Journal:

2017.12.15 14:24:15.762 2017.01.02 08:00:00   market sell 0.10 EURUSD sl: 1.07164 tp: 1.03164 (1.05159 / 1.05164 / 1.05159)
2017.12.15 14:24:15.762 2017.01.02 08:00:00   deal #2 sell 0.10 EURUSD at 1.05159 done (based on order #2)
2017.12.15 14:24:15.762 2017.01.02 08:00:00   deal performed [#2 sell 0.10 EURUSD at 1.05159]
2017.12.15 14:24:15.762 2017.01.02 08:00:00   order performed sell 0.10 at 1.05159 [#2 sell 0.10 EURUSD at 1.05159]
2017.12.15 14:24:15.766 2017.01.02 08:00:00   CTrade::OrderSend: market sell 0.10 EURUSD sl: 1.07164 tp: 1.03164 [done at 1.05159]

Having this print outs all the time makes it really hard to read my own print outs.......

 

Forum on trading, automated trading systems and testing trading strategies

Suppress print out from CTrade's buy and sell functions

syrvn 0, 2017.12.15 14:43

Hi there!

is it possible to suppress the print out from the CTrades buy and sell functions?

Here is my Code:

m_trade.Sell(0.1,_Symbol,last_tick.ask,last_tick.ask+SL,last_tick.ask-TP

This produces the following print out in the back tester's Journal:

2017.12.15 14:24:15.762 2017.01.02 08:00:00   market sell 0.10 EURUSD sl: 1.07164 tp: 1.03164 (1.05159 / 1.05164 / 1.05159)
2017.12.15 14:24:15.762 2017.01.02 08:00:00   deal #2 sell 0.10 EURUSD at 1.05159 done (based on order #2)
2017.12.15 14:24:15.762 2017.01.02 08:00:00   deal performed [#2 sell 0.10 EURUSD at 1.05159]
2017.12.15 14:24:15.762 2017.01.02 08:00:00   order performed sell 0.10 at 1.05159 [#2 sell 0.10 EURUSD at 1.05159]
2017.12.15 14:24:15.766 2017.01.02 08:00:00   CTrade::OrderSend: market sell 0.10 EURUSD sl: 1.07164 tp: 1.03164 [done at 1.05159]

 

Where did you find that post? This was my original but after clicking the add button the page freezed and I reloaded it and the post was gone.hm....We can delete one of them

 
syrvn 0:

Where did you find that post? This was my original but after clicking the add button the page freezed and I reloaded it and the post was gone.hm....We can delete one of them


You made two threads (with slightly different titles). So, I moved one post/thread to this thread, and I deleted the double thread (second one).
So, no problem.

 
Sergey Golubev:

You made two threads (with slightly different titles). So, I moved one post/thread to this thread, and I deleted the double thread (second one).
So, no problem.


Perfekt, thank you! :)
 
syrvn 0:

Hey hey!

is it possible to suppress the print Outs from the CTrade sell and buy functions?

I don't think this is possible.

What you could do is write your own output directly to your own log file using FileOpen, FileWrite, FileClose, etc.

 
Six years later:  I think it works using
m_trade.LogLevel(LOG_LEVEL_NO);
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradeloglevel
Documentation on MQL5: Standard Library / Trade Classes / CTrade / LogLevel
Documentation on MQL5: Standard Library / Trade Classes / CTrade / LogLevel
  • www.mql5.com
LogLevel(ENUM_LOG_LEVELS) - CTrade - Trade Classes - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5