Hi everyone, I’m looking for the best way to automatically export trade data in real-time whenever a trade is opened or closed. I would like to export the data in either JSON or CSV format. This is specifically for my students, as I want to track their trades and analyze them on my own platform
Can someone explain to me, how to get all trades to close at the same place, this is EA we are talking about? You have one that sells at 1.30000, but the market has not thought so, you add a trade at 1.30090, but the market has not thought so either so you add a trade when the market turns at
Trying to delete object: OBJ_TREND void OnChartEvent ( const int id, const long &lparam, const double &dparam, const string &sparam) { PrintFormat ( "%s: %d, %f, %s %s" , EnumToString (( ENUM_CHART_EVENT )id), lparam, dparam, sparam, EnumToString (( ENUM_OBJECT )
I am trying to capture in real time if any position is closed and then get its comment. not the last position in history. whatever i try nothing seems to work, here is an example can anyone give me a clue or it can not be done ! void OnTradeTransaction ( const MqlTradeTransaction &trans, const
Hi coders, I am looking for a JSON parser library for my MQL5 project . I have read some data online through WebRequest which is JSON data. I need to read it from MQL5 code to get the value. Thanks in advanced. #JSON_Parser #MQL5_Code
Here is a step by step guide for buying, installing, testing and using a Metatrader 5 Expert Advisor (Robot, Bot are whatever): 1. First make sure that you have the necessary funds required for your purchase in your MQL5 account, its always easier to pay with your MQL5 balance, than using a credit
Is the value returned by `AccountInfoDouble(ACCOUNT_PROFIT)` function the profit of all the currently open positions or today's profit of all the CLOSED + OPEN trades? I want to know the today's profit of my EA. How should I use this function
First off all, sorry for my bad english, my mother language is Spanish. Im programming an EA for Forex on MQL5 that opens positions when some conditions are met, the EA places a TP and SL based on some conditions and of course calculates the lotage to only risk 1% of the account. While doing
I checked with several brokers and found that, in cases where a broker offers both something like EURUSD and EURUSD.m ( it can be any symbol that has two versions in a broker ) and only the second symbol has full trading access while the first one is disabled However, the tester incorrectly returns
Hi all, I use this code to set Breakeven for my EA, but i got message : 2025.02 .05 23 : 14 : 28.843 2025.01 .20 05 : 51 : 32 failed modify #2 buy 1 XAUUSD sl: 0.00, tp: 0.00 -> sl: 0.00, tp: 0.00 [Invalid stops] 2025.02 .05 23 : 14 : 28.843 2025.01 .20 05 : 51 : 32 OrderSend error 4756 2025.02
MetaTrader 5 produces different backtest results when you use exactly the same settings for the Visual Backtester and Non-Visual Backtester. When I use the Visual mode everything is normal and goes as expected, when I uncheck the visual mode hoping to get the same results but faster, this is what I
Hello, I want to know if anyone else is having this problem. Since last update on mt5, my bot is running into problem when backtest in real ticks. When I start the backtest it goes normal, the cpu goes to 100% while the memory is loading each agent, normally it would be 100% CPU and about 40% of
Hi I have a graphic interface wrote with c# for my Expert Advisor. How can I just have a single instance of my interface for all the chart that I want to use my EA? Thanks for helping to solve this problem
Well, I have the next issue. I create button inherided from CButton class. TryIng to iverride OnMouseUp and Down functions to prevent a button click. But it doesn't work. I want to use a button as a label with a background and the ability to change its color. Or as a color indicator (light bulb)
Hello, I tried to debug EA in MetaEditor 5.0 (Start/Resume debugging on History data). Debugging works well but calling CTrade::PositionOpen results 'Market closed' error. I am debugging on history data, why market must be open? In reality, market is now open, but it doesn't work. I thought that
Hi, I tried to download an expert advisor on MT5, however it would not work. I then reached out to the company who then tried to install the EA, they told me to contact yourself as there were some errors in my EA's in MT5 (I have not messed with any settings). I was told to inform you that I’m
Hi, I have MT5 open with 5 or 6 charts. I use an expert advisor and various custom indicators . The charts move automatically, each tick is refreshed. But there comes a time, some chart stops, the ticks do not update, as if the market were stopped. The only way to refresh and resume tick event is
i am trying to capture latest closed position and print its info , everything is printing correctly but the comment is not at all , i tried to add small delay but no show !. void OnTradeTransaction ( const MqlTradeTransaction &trans, const MqlTradeRequest &request, const MqlTradeResult &result) {
Hello, If I start a fast genetic optimization including the use of cloud agents the optimizations proceeds normally through the backtest and works like intended, when it then proceeds on to the Forward testing it gets stuck just like you can see in the attached screenshot. Same thing applied to many
Hello I've found a small issue on canvas where if you erase a canvas with 0 opacity and subsequently save the placeholder bmp it does not save the bmp as an empty fully transparent one. Change ColorToARGB from ,0 to ,1 to see the difference . Thanks #include <Canvas\Canvas.mqh> CCanvas DESIGNER; int
Never needed before, but when you need, you can't find them ;) https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants#symbol_order_mode Not a bug, just incomplete ;) `pip list` shows: MetaTrader5 5.0 .4803
Hi, Buy 1 (+1 long) then Sell 2 (-1 short), then Buy 2 (+1 long)… Can I use "TRADE_ACTION_CLOSE_BY" for this strategy ? Is it useful, does it save transaction fees in this case ? If yes, how?? No Ctrade library please. I've spent hours trying to find a MQL5 code example !! Thank you
Hello, for Metatrader5 in python, market_book_get is not working. It always print "mt5.market_book_add('EURUSD') failed, error code = (1, 'Success')". How to solve this problem ? Thanks This is the script: import MetaTrader5 as mt5 import time # display data on the MetaTrader 5 package print(
double lots= GetBoomLots(inpRiskPercent); if ( PositionsTotal (B1Comment)> 0 || PositionsTotal (B2Comment)> 0 ) { if (TakeprofitnPartialClosure(inpEA_Magic,inpTypeLot,flotsize,inpTsl_percent,inpTsl_trigger,inpPClosePercent)){ //trailstoploss
Hello MetaQuotes Team, not sure, if this is the right place. I give it a try. Is it possible to implement a general function for opening an url using system browser? That would be very useful, as it would be possible to make help / reports available right from within expert. Currently this is not
ChartGetInteger ( 0 , CHART_BRING_TO_TOP ); It should return a value of 1 (or true) in visual testing, but it returns 0 (or false). Meanwhile, in MT4 testing visual mode, it returns 1 (or true). It should be the same. Could you please check this? Thank you
Dear community, when publishing my expert I get an error message that external DLLs are not allowed. I do not explicitly use external DLLs, but it could be, that this means user32.dll and/or shell32.dll. The DLL shell32.dll is used to open a browser from the Expert. I would like to use it to open
ChartSetInteger ( 0 , CHART_SHOW_TRADE_LEVELS , false ); It does not work in MT5 Strategy Tester (visual mode). You can try it yourself. This is important for me because it obstructs my trading bot’s display. Please check and fix it in the next build version. Thank you
I have a problem, I'm running MetaTrader 5 Strategy tester with 8 agents (my computer has 16 cores). He hasn't worked for me for a month. There is no collision with the anti-virus program. Reinstalling didn't help either. All 8 testers are marked as "not connected" in AgentsManager. I have Win 11

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
If you do not have an account, please register
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.