EA only places one trade with the correct sl and tp but it never opens another trade #property copyright "Copyright 2022, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" #include <Trade/Trade.mqh> #include <Trade/PositionInfo.mqh> CPositionInfo m_position;
Hi all I would like to check in the expert advisor if the markt is open/close. What's the easiest way to do that? I don't want do check that over time. I also need to know when the market open again after the short close every day at 11pm. Thanks FX_TA
Hello Guys im trying to find the simplest way to run the configurations of my settings rather than manually adjusting the inputs window, since I run my EA multiple time in the same pair, I have to manually put each settings one by one, is there's a simplest way to do that? like just running the EA
I created a custom synthetic symbol for NAS100 and did an optimization. after the optimization was completed, i ran a single test for a parameter and then checked the backtest results and the first thing i see is History Quality 0%. I am using Every tick based on real ticks model and the single test
I'm trying to make a code to execute a script like this: // Check the account equity and disable trading if needed void CheckEquity() { double equity = CalculateEquity(); if (equity - initialEquity >= takeProfit || equity - initialEquity <= stopLoss) { tradingEnabled = false
Screenshots of code removed by moderator
Im writing an EA which will place market order at a specific time, everything seemed to be right, no bug, no warning were found when I compiled it. But the problem is when I run it, the system kept warning that my order is invalid CTrade::OrderSend: market buy 0.66 EURUSD sl: 1.07209 tp: 2.00000
I'm trying to use data from the MACD, and according to the documentation index [0] should contain the most recent data point. However I have found that the opposite is true. If I get three data points, [0] is the oldest whereas [2] is the most recent (changing on-tick as the price fluctuates). The
Hi I have created AI bot written in python. How to convert it to .X5 to upload on the market? I have three .py files and one .csv and one .h5. These 5 files are one project , i can connect it to MT5 and predict candles. However, for MT5 market it accepts only .X5 file. So how to convert my python
A major missing element in the MQL language is a universal None type like in Python. MQL5 has "WRONG_VALUE", but with double, for example, it sets the value to -1.0 which is unacceptable in most cases. It became an obvious issue when I was debugging a substantial project and come to find-out that a...
I have a python script I want to implement on MT5. How do I do that
The documentation says: Only part of the request was completed I just want to generate an alert if ever it happens, but are we 100% sure what the return code means? Even though most of us probably never got that error code and can't test it in a demo or strategy tester, do we know if we would get
Hi all, I'd like to test my trading strategy on different days of the week. I've 'followed' the instructions here but I don't seem to understand how to use the functions it suggests. Below is my code; #include <Trade/Trade.mqh> CTrade trade; CPositionInfo myposition; input double cLot= 25 ; input
Hi i need help with some coding , i have code that creates horizontal lines on the chart , but i need trades to execute once those lines are touched (do not want to use pending orders) only 1 trade should be active at a time and there after the the code can loop. please assist if possible
Hi, I'm not Pro in coding I created a code to draw a rectange on the chart and filled with red colour I have 2 problems 1. The Object is listed in Object List but not appear on the Chart except when check it's properties and click OK. 2. Want "Time 2" to be a 2 weeks back shift. Here's the code if
Hi, On MT5 When calling an indicatorf from and EA using iCustom or iMA: is it possible to set the Parameter "Style" to set the color of those indicators? This is useful in the Strategy Tester Visualization, since creating the handles will draw the indicators too (very useful) BUT I could not see a
Hello guys, Someone can explain why it is that: long leverage1 = ACCOUNT_LEVERAGE ; returns value: 35 and long leverage2 = AccountInfoInteger ( ACCOUNT_LEVERAGE ); returns value: 300 Why these two do not return the same value
Hello everyone , I have encountered a problem and hope to receive everyone's help , thank you ! My question is very simple, just is to get the total positions My code : #include <Trade\Trade.mqh> CTrade m_trade; int OnInit () { return ( INIT_SUCCEEDED ); } void OnDeinit ( const int reason)
I developed my own EA, based on a simple martingale style. The order placement worked perfectly when I tested this with a demo account. When I started with a couple of real trading accounts, there was no issue to place an order. All orders directed by the EA were placed without any missing one
I have a robot in MQL5 that I use to trade assets on the Brazilian stock exchange. The robot works perfectly for opening buy and sell orders, but when testing it with BTCUSD, it fails on the sell orders. Looking at the logs in the Experts tab, it seems that the values are correct, and I don't
I have written an MQL4 Expert Advisor code: It should open a BUY position, if the EMA12 crosses above the EMA28, and then a SELL position, when the EMA12 crosses below the EMA28. It examines this condition at the close of every 1 minute candle. Only one BUY and one SELL should be traded, so I used a
Hey guys, Is this function for sending an asynchronous order useful for a strategy that does not use market orders? My EA only uses stop orders to open a position and limit orders to close (take profit), and my question is whether placing an asynchronous operation would have any advantage. I am
HELLO, Am new to MetaTrader; How should I modify the " Moving Average Expert Advisor" so as to (1) Signal (buy/sell) INTRA-BAR other that at close (2) Signal only ONCE PER BAR (3) BUY ONLY and/ or SELL ONLY but not both Thanks //+------------------------------------------------------------------+
Good day, I have been using a free EA in mt5 but today it was updated to a new version which is no longer free. Will the old version I have running still work or do i have to buy the new version? Thank you for the help
I just find this issue. And I double check and confirm this issue only occur on 3757. I am running several mt5 instances on same vps. EA on 3661 works fine, but on 3757, EA can't access url. I am sure my web request setting on terminal is right. I closed 3757, then I copy main exe file of 3661 to
I am trying to compute lot size having stop loss (as price) but the lot size ends up quite big and eventually, I get an error: Error code: 10014 Error message: Invalid volume My current code is: import MetaTrader5 as mt5 def calculate_lot_size(symbol, stop_loss_price): # Connect to the
Good day everyone I please need someones advise on the following. I have the attached EA that I have made. Everything is working fine but there are one problem that I cant seem to resolve and I have really tried my best. I have a maxTrade function so that when my "sellcondition" is met the EA needs
Hi, I have two trade filter of boolean input variable that I will use in my entry strategy. If the first one is true than use trade filter A and the entry strategy, the code is like this, void tradeSignal(){ If(InpUseFilterA) If(Filter A && entry long strategy) return OPEN_LONG;
Hello there! I'm converting my expert advisor to Metatrader 5. With hedging, the handling and calculation of positions is quite reasonable. I might need to stay away from netting accounts. But how do you handle positions with netting accounts? Example 1: You buy 0.1 lots of GBPUSD at 9 am and
If I create an EA* and use SymbolIsSynchronized() on EURUSD for example:
int OnInit() { bool result = SymbolIsSynchronized("EURUSD"); printf("sync status: %u", result); return(INIT_SUCCEEDED);};
The terminal prints the following:
EURUSD,H1: sync status: 0
No matter what I do (change...

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.