Expert Advisors and Automated Trading - page 116

Hello, good day programmers, I have tried to eliminate the arrows and trendlines from the autotrades but they are only removed from the current chart but not from the other charts opened by the strategy tester. and in the same way when I call the function in the OnDeinit() part they are not
  Symbol Equity  (4)
Hello, I want to calculate the equity for each symbol separately, but my current code calculates the overall account equity instead. For instance, if my trading bot handles multiple currency pairs, and I only want the equity for the EURUSD pair, what code should I use? Can someone assist me in
Below is a code that creates 2 bitmap object. These objects gets resized accordingly whenever there's changes to the chart ie slide, zoom. You will see those objects flickering when you slide & zoom. Thanks! #property copyright "Copyright 2023, MetaQuotes Ltd." #property link
I have a script letting user to customise the chart properties. I use ChartSetSymbolPeriod to change the chart timeframe. my last input in the script is to save the template. problem is ChartSetSymbolPeriod causing the script to be terminated and then I recieve error in applying template. How to fix
Hello everyone, I hope you're doing well! I am currently working on developing an Expert Advisor (EA) and facing a challenge. I need to obtain the ticket number of the last position immediately after opening it. I am using the following code for this purpose; however, I am encountering inconsistent
I love MT5 but there are some problems that does not allow me to switch from MT4. 1. The spread in the backtests comes from the data and we cannot define a value. We know that spreads change a lot from broker to broker and having a fixed predefined value does not allow to test certain strategies and...
Is there any way to check some open order when the user clicks the button to close the terminal and prevent the terminal from closing until the order is closed? I tried doing it in the OnDeinit event but it didn't work: void OnDeinit ( const int reason) { if ( PositionSelect ( _Symbol )) {
Assume I want to get data from page https://www.abc.com using web requests However in the Allowed URL user input https://abc.com because when copy pasting from browser the www gets neglected. The web-request fails in this case as the web request returns -1. My understanding is Allowed URLs list
My demo terminal is not setting a position identifier for positions ... and naturally it is absent also for deals and orders on the history tab. What can be the reason? Thanks.
[Deleted]
I have been facing some issues on testing OnTimer but it does not happen always only sometimes so hard to record the event, Timer stops and I also use time compare like if current bar timelocal is not syncing fast to last 2 bars time then alert ,so i may know when OnTimer function freezes and i can
double array[ 10 ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }; double array2[ 10 ] = { 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 }; for ( int i = 0 ; i < 10 ; i++){ ArrayInsert (array,array2, 0 , 0 , 1 ); } ArrayPrint (array); To provide some background and a simple illustration using a 1 d
Help Me❗ How to connect 2 Forex Robots that do not have the same Magic Number? Hello Bro. Currently, I have 2 Forex Robots trading on the same account with the same currency pair. However, these 2 Robots do not have the same Magic Number (this is my own intention because if set up with the same
The product validation of my EA keeps failing, so I am unable to add it to the market it is an EA based on indices and should work on NY open till close. Due to the fact that no time constraint is allowed, I made the time constraint optional and the default time to be all through the day but it can
I am using MQL5 in Borsa Istanbul. I trade in futures markets. In our exchange, just like in cryptocurrency exchanges, buyers and sellers place market maker orders, and this is how the market is formed. There is no spread like the FX markets, instead the buyer and seller meet at the best price and
Hi every one, Is it possible to find out from the asset description whether we can go long and short at the same time, or do we have to do the test ourselves and open 2 opposite positions? exemple on USDJPY here : Best Reguards, ZeroCafeine 😊
[Deleted]
Hello, I have an ea in my hand. but I don't have codes. When EA opens a transaction, is there something that will automatically reverse that transaction, disable the robot, and then activate EA again when the transaction is completed? Is this possible
#property copyright "Copyright 2023, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" #include <Trade/Trade.mqh> CTrade trade; int handlefastma, handlemiddlema, handleslowma; double Ask = SymbolInfoDouble ( _Symbol , SYMBOL_ASK ); double Bid = SymbolInfoDouble
  Rates position  (1)
Hi I'm traying to make this work, but can make it work propperly. I use this: MqlRates rates[]; ArraySetAsSeries (rates, true ); int copied= CopyRates ( _Symbol , PERIOD_CURRENT , 0 , 7 ,rates); if (copied<= 0 ) Print ( "Error copying price data " , GetLastError ()); but when testing
i am a newbie of mt5 trader. i was practicing my coding with the moving average strategy. but there is a problem happened. i can run my code but the journal always shows me "failed instant sell 0.001 EURUSD(UST+3) at 1.0906 [Invalid volume]" when i make the order. is anyone can help me to point out
Can any1 tell me how to get a specific time using it historical Ask price to backtest a EA THX
Why during mt5 backtesting shortkeys(+ for zoom in , - for zoom out) are not working
Hi all, I think it should be already included, but... 🤷‍♂️ The MetaTrader 5 package for macOS is perfect. It works perfectly with wine. But it doesn't come with python package. If the user knows how to use the wine command (like me) can try to install python into it. But, I don't know why the
Hello Community, I am new, and have been getting amazing results with back testing on a demo account. Once I open and fund a live account and apply the exact same EA and variables, should I expect similar results? I have watched some videos, and I do not expect the exact same results, but possibly
Trying to create an array, which will hold say 10 arrays each of size 5 made up of type double
Hello, I am not sure if this process has been explained elsewhere.. but I will proceed to ask the question here. I want to run two Expert Advisors on the same account. One would be executing trades and the other would be monitoring the daily drawdown then send an alert if it comes close to a limit
EA wont work. any help? i ve tried lots of clean install.. changed many setting. stuck,, it did work for a few day
  4 EMA bot  (2)
Hello guys. I am in the process of developing a bot for MT5 but I simply cannot get it to work as I want. It sells when it is above 55 and buys when it is below. It should make a buy when it crosses EMA 55 with EMA 8, 13 and 21 and vice versa. THANKS! :* File is added below
I'm trying to run this code I got from the documentation page: from datetime import datetime import MetaTrader5 as mt5 # connect to MetaTrader 5 if not mt5.initialize(): print("initialize() failed") mt5.shutdown() # request connection status and parameters print(mt5.terminal_info()) # get
How to create multiple Bitmap using CCanvas? I have coded a sample code below. When you attach it, you will see only 1 Bitmap instead of 2. Notice in the CreateBitmap function, both has a different name. #property copyright "Copyright 2023, MetaQuotes Ltd." #property link
  find Chart ID  (4)
I use two time frame in Strategy Tester . with function ChartID () i can find first chart id . who can i find second time frame (in this screenshot M30) Chart ID