How do I change the value of a global variable from inside a function. I tried simply Globalvar1 = 1 ; void changing.globalvar1() { Globalvar1 = (Globalvar1* 2 ); } But this does not work. How do I achieve this? Thank you
hello when conection is green/red robot can open trade? Green/red means a direct connection to the server
I want a code that close position 24 after its opening. thanks
I need to get the ask, bid and volume from various assets. I'm looking at the book. But apparently this only works if the EA is attached to the asset. Does anyone have any ideas? MarketBookAdd (units); MqlBookInfo BookInfo_unit[]; MarketBookGet (units,BookInfo_unit); for ( int i= 0 ;i<
The default option to optimize using "Drawdown min" uses "Equity drawdown maximal". I would like to code a custom criteria which uses "Equity drawdown relative" to optimize. I looked up the OnTester documentation but couldn't really understand it. How could I define a custom max criteria which is
I want to to create a trailing stoploss and draw a dot on the chart to track the changes. The dot tracker works but it moves in both directions I only want it to move up with a buy position and down with a sell position. Also the stoploss itself doesn't modify. I'm sure there's a simple solution but
Hi guys, Im new to MQL5 but havent had problems until now. I have coded a simple MA cross but it wont compile? 'Unexpected end of program & unbalanced parenthesis' on lines 14 and 50 This is the code: ***
Hello everyone, I am calling you because, as you can see, my current code will close a position when it takes 130 pips, I am trying to change it to close the position when it makes a profit of 1 euro (1 euro for example), the take profit will be set automatically so that a profit of 1 euro is
Hello guys, I need some help getting my EA to work properly. The thing is, he can modify positions, but only if I assign the EA to my symbol chart with autotrading ALREADY ENABLED. If I assign the EA to the chart while autotrading is disabled (disabled via the button) and attempt to modify position
Hi how do I code an EA on iPad. the app is great for live trading but how do I get the editor on an iPad? should I use something like Remote Desktop or some kind of OS emulator? thanks
Hi I hope you're fine. If we were launching an EA, and when the connection stopped, then reconnected, we had to restart the EA? THANK YOU SO MUCH
Hi guys, I'm #C programmer and I start to design a new project in #MQL5. Has anyone been able to calculate the exact amount of the #maximum #lot in #MQL5? I used This Function But Sometimes Happened Error "Not Enough Money" . I think Some other parameters are also effective in determining it
This might seem quite trivial to some but I just can't seem to figure it out. I have a global variable 'bestMatch' that I keep updating within two for loops as seen in the relevant code below. How can I make sure both sets of nested for loops are have completed updating before I perform any further
Hi All, please help me, I keep getting the below error when I attach EA to a TF. When ever it tries to execute a trade it fails with the error. Failed Market error (only position closing allowed) What can I do please
Hello Guys, I have created a simple RSI based EA. I would like to add one bar confirmation in it. For example, lets say that if EA would take a "BUY" trade when RSI is 60.....then instead of taking a trade right away.......EA should wait for one more candle and if it is also green then only EA
I have an EA that enters a stoploss based on the low of the last '5' bars. This is updated each bar to make a trailing stop. There is also a dot drawn once a bar to track the updated stoploss. This has been working fine and I have backtested it multiple times. I have recently purchased a third party
Hello I was wondering if anyone know how to code EA, reverse "Trailing Stop Loss" into "Trailing take Profit"? thank you
Hi all! I'd like to ask if there is any sort of EAs analyzer. I have a few EAs running and I need to know, throughout the days which they run: which trades have been made by this EA, percentage of success trades, overall gains and losses, and overall aspects which are shown in EA tester tab after
i'm trying to create my own report/analysis and found that the Order record returned does not contain the correct TP/SL shown in the account history. in account history i'm already looking for both all in and out order's SL/TP and still nothing. can anyone advice
I'm trying to use a TensorFlow/Keras Model but didn't find a way. My final purpose is to sell it in the mql5 market so I can't use DLL's or something like that. I will appreciate any advice
Hi, I just started trading on a demo account in MT5 and I'm an absolute beginner to forex. I've been experimenting with several expert advisors at the same time, and so when I look at my history, it shows me all the executions done as well as the total profit/loss. If I hover over a trade, it shows
Hi, there! Anyone knows how I can set up my MT5 EA orders to Market on Open (MOO) and/or Market on Close (MOC)? My goal is to day-trade stocks in the largest US exchanges, getting their open and close prices. I haven't seen MOO and MOC options anywhere. Digging the MT5 documentation, I only found
Hi, I wrote a linear grid EA that generally works fine except on some testing scenarios. At some point in time, some orders will expire multiple times and others won't expire at all, and the status of the orders will still be like if they were open. See below for more details. Does anyone knows how
I want to call SymbolInfoString () for another currency pair, but I'm having trouble onthe tester. If EA call SymbolInfoString () for another currency pair, its currency pair will appear on MarketWatch. However, its price is not displayed and but also cannot be used to calculate the profit and loss
hello I'm going to try to color-code this to make this easier to understand, hope this help. IF ANY IDEA PLEASE SHARE! THANK YOU I'm trying to add "CheckTrailingStop" this to "trade.Buy" in the S top-Loss Price Place . is there away to only have the CheckTrailingStop And NOT Ask-1000 or 0 if
Can someone help me to solve the error? Is it because there is no input for slowmovingaverage or others problem? I'm new so please help is anyone knows how to solve the problem
Hi,
Does anyone have a script that automatically set Buy Stop/Sell stop when an open position (Buy or Sell) has been executed?
Like for example:
1. Buy Order has just been executed via instant order orpending order. Script will run to have Sell Stop Order below the recent Buyopen...
Hello y'll. By any chance, does anyone here have an EA that increase the lot not after a lose trade , but after a drawdown % (balance / equity). Any help would be much appreciated. Thanks in advance
Hello, Can anyone help me to make changes in this code: 1- I want to change Sl of Buy position to become ----> the lowest low in the last 100 candle from opening time . 2- I want to change Sl of Sell position to become ----> the highest high in the last 100 candle from opening time. 3- I want to
hello everyone i'm facing " invalid request " error while opening *SELL* order using mt5 python api: for example current price is 1880.00 here request is my code: request = { "action" : mt5. TRADE_ACTION_PENDING , "symbol" : symbol

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.