Expert Advisors and Automated Trading - page 85

//+------------------------------------------------------------------+ //| Expert.mq5| //| Copyright 2023, MetaQuotes Ltd.| //| https://www.mql5.com|
Hi, I am trying to debug a very simple program in mql5. In the journal tab I get the message that the start time has changed to ........., which is about three days after when the data actually starts from. I have outputted alot of the variables to the journal tab so that I can see what is what
Using a hedge as a stop is a strategy I have been using to manage risk on swing trades. Is it possible to set trailing stops on an order? When I have tried placing a stop order , choosing a stop loss, I can't make it become trailing. I have seen other threads about missing a trailing stop. But
  Discord API  (1)
Hi, i would like to develop a EA which communicate via Discord. Are there any Discord API / Documentation for MQL5
  Tick history missing  (12   1 2)
Hi, was testing this code: #define FAIL (-1) #define AS ArraySize #define PF PrintFormat #define TTS TimeToString datetime test = D'2021.09.06 00:00:00' ; MqlTick ttt[]; if ( FAIL != ( CopyTicks ( _Symbol ,ttt, COPY_TICKS_ALL ,test* 1000 , 10000 )) ){ for ( int i= 0 ; AS(ttt)>i; i++){
I've read the documentation and I understand you need to select a symbol using the Name method in order to use any of the functions of CSymbolInfo. What I don't understand is how to do that. Every function in the documentation says: When I click on that all I get is: Sorry if this is an obvious
Hello, I can't run Test Strategy on any Expert, error: "optimization max" criterion not started, no Ontester function in....." (any expert) which is not possible. anybody know why and how to fix this? it use the work and stopped. MT5, TY :)
This has been driving me crazy, so I finally ground through and figured out exactly what is going on. In the MQL5 wizard, if MA or PSAR trailing stop is selected, it doesn't work correctly (an otherwise profitable strategy becomes unprofitable) if the initial stop loss is set to anything other than
Hi .I am building a strategy based on martingale. Because the pipe size of TP and SL is not the same in all positions and is different, I am confused about the position volume calculation , please guide me. The basis of the work is that the position is first opened based on the fixed volume of 0.01
Dear Fellow Members How can I programmatically get the Symbols trading session timings for different assets I plan to trade in? So if I want to trade in AMZN Stock, I need to know the timings and programmatically restrict POSITION open and POSITION close just before 'Trade' Hours Close e.g. close at
Left is my EURUSD 1H chart, right is the backtester during a test around the same time. I noticed this because I use the Python API to get data, and as on the left, the 6th hour bar does not exist, but it was traded on. Can anyone explain this
I already made an Indicator that shows Economical Events on chart as Labels. Now I want to show all those events on a AppDialog panel. Most of the times events list is long that overflow from the chart. So I need a vertical scroll on panel. Only ListView object has by default vertical scroll where
[Deleted]
I want to filter normal clicks on chart with clicks on objects I am using this code but its not working if (id == CHARTEVENT_CLICK && id!= CHARTEVENT_OBJECT_CLICK ) { //print something } How can I filter in these two types of clicks
  MT5 Tester issue  (6)
Hello everyone, I want to ask one thing about mt5 strategy tester, I am testing an EA on M5 chart, I select M5 in settings and when I click on START to open new tester window it start testing on D1, further the suspicious thing is that It shows M5 at above left corner of chart but candles are
Hey i developed an EA - it opens very much orders. 100 and more per day. I made there specific parameters for TP and SL. After some pips Profit it trails the SL to BE and then like a normal trailing stop. In the backtests it works perfect. When i do it on a live account the trailing system doesn't
Dear all, In reference to this tutorial at https://www.youtube.com/watch?v=TAzM5Vd9nLs where I need to convert Symbol values into my accounts currency. I am looking to resolve the following: How can I know (programmatically) the currency of a non forex Symbol say UK100, GER40 or XAUUSD ...! I have
Attached Code of My EA (relavant parts only) //+-----------------------------------------------------------------------------------------------------------------------------+ //| INPUT: Input for variable used in the expert advisor //| NOTE: Indicator parameters defaluted in CBase class (
The SYMBOL_BID and SYMBOL_ASK are always returning zero. Did I something wrong? #include <Trade\Trade.mqh>#include <Trade\SymbolInfo.mqh>#include <Trade\AccountInfo.mqh>CTrade trade;CSymbolInfo symbolInfo;CAccountInfo accInfo;int OnInit(){   if(!symbolInfo...
Hello.. &nbsp; I want make Candlestick EA in one file mql5. no dass library..&nbsp; So I want convert Candlestick Indicator to Expert Advisor..but have problem with&nbsp;OnCalculate.. OnCalculate only for indicator..For Expert Advisor only ontick.. For EA this not able to use this OnCalculate...
Hello, I am currently in the process of back testing an EA on MT5. I want to use the Every Tick Based on Real ticks option. The broker I am using is Tick Mill (a well known broker) from a demo account. Does anyone have any experience with this tick data? In terms of accuracy, is it above 90%? Can
HI, I'm coming from Excel VBA and relatively new to MQL5. In VBA IDE, we can set a condition formula in Watch Window (e.g., Var1 = 3, Var2 = 7, etc.) and Debugging will pause automatically when that condition becomes true. In MQL5 IDE, can we do something similar without having to insert
//I have a problem that I need your help to suggest. In the backtest process, there is only one open order. after it closed There are no more open orders. How do I fix it? #include <Trade/Trade.mqh> CTrade trade; //+------------------------------------------------------------------+ int
no errors, but no trades are done while testing ... why? //#include <MetaTrader5\MetaTrader5.mqh> #include <Trade\Trade.mqh> #include <Trade\AccountInfo.mqh> #include <Object.mqh> // Resto del código de tu programa // Definir los parámetros de entrada input int MA_Period = 20 ; // _Period de la MMA
Hi all, please let me know if I'm allowed to ask this or if I'm in the right section but can someone answer my question. So ive published a product (EA) with the wrong name to what I wanted, now I cant change it as its been published. Am I able to hide the product from market (as you cant delete)
Hi guys, today I experienced a very strange EA behavior when i tried to read from a txt file in the MT5 tester. The file is located in the "normal" terminal folder and should be loaded by using #property tester_file. Since it did not work with the txt file I also tried opening a csv file. Now the
Hello everyone, I'm new to coding, currently Im writing one that will open trade based on a specific time. For example, if the current time is 21:00:00, and match the condition time, it will open a market order. However, the problem is the OnTick() function requests the order continously, it lead to
What is difference between Symbol() and _Symbol? Any help would be highly appreciated. 
Hi Guys, I was backtesting my EA on two different brokers ( all two proposed by terminal in two different PC) , brokers are specifically : AMPGlobal ( IP=78.140.180.54 located in netherland) and MetaQuotes-Demo IP=78.140.180.48 located in netherland ) the problems is that I started the EA with a TF
//+------------------------------------------------------------------+ //| trailing_stop.mq5 | //| Copyright 2023, MetaQuotes Ltd. | //| https://www.mql5.com |
How can I fix a trading algorithm that was encoded my trading ID, to put another ID because I want use another broker Please help. the developer is not responding to me to assit