I am trying to backtest an expert advisor and limit the number of pending orders to 1. However, when I place an order using the CTrade class, OrdersTotal() is still returning 0. I found this forum post but to no avail. Here's the function I'm running and the output: void Buy() { double sl = iOpen
Let's say I have 50$ to spend on single position. It is 1/100 of my account - this is my strategy (EA). How can I calculate size of position in lots based on FIAT? I'd like to use the same EA for different markets - I don't want to hardcode position size
When tested to be traded why? Compiled Many times Changed the location return Comment out traded method Delete .mq5 file The result does not change //+------------------------------------------------------------------+ //| FXModel_exp.mq5 | //|
I'm having trouble getting subplots to appear for expert advisors. I only have this problem while testing on live data - when backtesting on historical data everything works fine. Is there a setting that disables subplots from showing? I am a relatively new user, so maybe I'm missing something here
Hi friends, what's the proper way to have a persistent SQL connection during Optimizer passes? I tried opening, writing to and closing the database after each pass using MQL5 native commands but it didn't work. It did work when using the EA normally. Thank you for your comments
I declare arrays open,high, low and close and use copyopen to copyclose to get details of previous candles. I dont declare ontick() but use OnTimer() with a timer value same as timeframe of chart. this helps me get these details of any number of previous candles. Now suppose i am working in 15m with
Hi, I'd like to know if there's any service that can connect to Telegram/Discord APIs to read signals in channels? And then forward those signals to the broker/exchange/MT4/MT5 API to open trades? If not, does anyone here knows how to code that and will be willing to work on it? I'm looking for a
Hi, I ask the more experienced a doubt since I have not been involved in MQL4 programming for long. Up to now I have used Alpari data at 90% for backtests, but seeing that everyone recommends doing them at 99% (Since I understood, the difference is considerable) I tried to download the data from the
Say I have a long position of 0.01 which I want to reverse hence I sell 0.02. I sent the an opposite order with the position ID so as to have the reversed position also to have the same ID. I get invalid volume error. How do I rectify this error? Can I retain the same position ID ticket for the
This is what I have for using iFractals but I'm not able to comment the values of them properly as per the chart. I don't think I understand how to use those % symbols to get the values that I'm looking for. The following gives me some random values that doesn't reflect as per the indicator from the
Ussually, It happens several times, that once a forward simulation has been carried out, when you press "Start simulation" from forward window, the terminal hangs. do you know how to fix it
Hey, I'm having a issue on a ATR indicator. Even though the codes don't have any problem when compiling, it doesn't plot on the screen. I think there is a thing that I didn't get on PlotIndexes. I also checked the datas of arrays(ind_buffer1, ind_buffer2) and nothing is wrong, the data is correct
Which is considered the best VPS for metatrader? A reliable one that will rarely crash so you can feel confident about leaving an EA running 24/7 and not worry about constantly checking if the server went down, the OS crashed, etc... Thanks in advance PS: I don´ t know if it is allowed to post links
hello friends, can anyone help me to make an EA with a single moving average indicator? keep making TP/SL based on percentage
Hello friends
How I get 99.9% modelling quality on MT4 build 950 ???
Just to tell a not so grave bug i have had for a while now : in the tester, when optimizing some parameters of an EA, dots results are being plotted on a window, the bug is : if you close some window in the background, the current window stops displaying dots results. Even the optimization
How To Make EA Trade Only Once A Day , Please Help Me If My EA Open Trading Method Execution Is Correct And I Want It To Only Execute Once In That Day And Not Allow My EA To Open Other Trades And Not Fixed Time To Open Trades Of The Day Can Someone Tell Me How I Should Do It , Thanks A Lot
I want someone to help get asimple free code for mt5 with trailing stop ..actvate after profet with stop & step...and with stoploss and take profet ...thank you in advance
I have been trying to program various strategies and have been able to figure out how various timeframes react with various strategies. Some of these are particularly good with metals which I can't figure out why. so any ideas on this situation? Also since I trade forex only, I notice than randomly
Does anyone know of how to obtain a reliable arbitrage EA for Mt4/5
//+---------------------------------------------------------------------------+ //| Margin Leverage from the broker - for better calculations on big accounts.| |
Hi there community, I've got a doubt on this lines. double GlobalTarget =(((Positive+ PositionsTotal ())/ 2 )*Equity)/ 100 ; double TakeProfit=GlobalTarget; if (Positive> 0 ){ TakeProfit = NormalizeDouble ( GlobalTarget /Positive, 2 ); GlobalTarget =GlobalTarget/( PositionsTotal
Hi There; I've written a system on EA that hopefully executes multiple symbols concurrently. I=t works perfectly per individual instrument. just need to find a way to execute it properly on multiple symbols. The error starts at ticket 50+ for 2 instruments on the backend. meaning i'm able to
Hello, I am working on being able to input an array of values into a moving average function to be able to create an MA of any set of data basically. But before I get to that point, I am trying to improve my knowledge of arrays as I feel under-developed. I am simply trying to put the Ask value into
I have plan to Handle scenarios may cause Expert malfunctioning. This is Error codes may return in the run time. However, I want to handle these errors and some may not even Return errors. I made this topic to be a start point for something big and every one who is willing can contribute. I will
Hi Can anyone help to initiate trade when price is above MA and high of three bullish candle breaks
i am trying to figure out how i can replace these call functions in my EA so that i can submit them for mql5 market. i am new to coding so i know the easy way of doing it by using user32.dll then it allows me to A) close trades or B) turn off EA trading in total The ea i am building is for Trade
bool MarketClosed() { bool closed= false ; MqlDateTime STime; datetime time= TimeCurrent (); TimeToStruct (time,STime); datetime date_from, date_to; bool session_exist= true ; uint session_index= 0 ; //--- get over all sessions of the current day while (session_exist) {
I bought an excellent mt4 expert, it works very well in the moments in which the trend is not very directional but when there are certain periods with very strong trand in a certain and constant direction it must be stopped otherwise it goes into OTM. I would like to know if there is a way to stop

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.