Expert Advisors and Automated Trading - page 90

Hello, I've been trying to add a true/false input for use of time filter, however i get the below error. Probably missing something obvious. Any help is greatly appreciated. 'fCheckTradingTime' - Wrong parameter count inputs input bool useTradeTimeFilter = true ; input string InpStartTime = "01:00"
can someone please give me MQL5 equivalents for the MQL4 functions below: IsTradeContextBusy() RefreshRates()
I am coming to you because I want to create an EA by a freelancer, but I would like to know how it works if I want to include two indicators that are on TradingView only? How do you act when I say for example "I want the RSI TDI indicator"? Where do I look for the source codes of the chosen
Hey, An EA has been running on a demo account for a couple of weeks. However, when trying to backtest the EA over the same time period the results don't match. How do you set up backtesting (or the EA) so that the results match
I was testing an expert . in two modelling "Every tick and Every tick based on real ticks" . The results are completely different. I thought that the overall result should be only slightly different. If the results are so different, why do we need to use "every tick"? After seeing this difference, I
Whenever I backtest this script, It wont open any trades...why is this happening??? #include <Trade\Trade.mqh>; CTrade trade; int input length = 20 ; float input stdv = 2.0 ; double input tpPoints = 10 ; double input slPoints = 40 ; int boll = iBands ( _Symbol , PERIOD_CURRENT ,length, 1 ,stdv
I have a global variable ulong posTicket; and on the onTick function I use this condition to open a trade if(posTicket<=0) { trade.Sell(lot_size, _Symbol ); posTicket = trade.ResultOrder(); } Using a print statement I found out that the global variable does not hold the ticket value and is 0 at
Is it a good practice to set a random large size for your arrays, I'm converting an indicator from mt4 to mt5, the code compiles with 0 warning ⚠️ and 0 errors. But the expert tab screens array our of range. I don't seem to understand exactly what's wrong. What's your advice on this
I use this to get an array of the highest bar prices: copyed = CopyHigh ( NULL , 0 , 0 , 5 ,clpr); I use this to get an array of the lowest bar prices: copyed = CopyLow ( NULL , 0 , 0 , 5 ,clpr); How can I get an array containing the average of the high and low? Thanks
Hi, I will like to know if I can create or add an indicator or strategy to a tick chart for EURUSD
Hi, I'm now in programming and I have this error with this function void CheckEquityLoss() { if ((AccountEquity() < AccountEquity()(1 - EquityLoss/100))) { if(filterMartingala) Chiusura(); CloseAllBuy(); CloseAllSell(); } } in this function I want to close all trade if my
Hi all! I'm coding my very first trading bot, but i'm stuck on this point since a while, even if i've looked to the guide deeply... I have coded a bot that i sending telegram messages every time that i'm doing an action on MT4, and is also saving the operations to a csv file like this one: Order
Good morning, I would like to tell you my little problem and see if you can help me. I am new to programming. I have programmed a robot that when doing the backtest works perfectly and carries out the operations in the way I want. The problem is that when I switch it to real, the robot closes the
I have an existing EA that i use on different brokers with the following formular to calculate it's position size: double GetLot(double risk, int sl = 0) { double Free = acc.Balance(); double tick_value = smb.TickValue(); double tick_size = smb.TickSize(); if(sl <= 0 || tick_value <= 0)
Hi, I would like to do the following: EA.mq5 #define FILE_TO_INCLUDE "Env1.mqh" #include "Body.mqh" Body.mqh <... som stuff ... > #include FILE_TO_INCLUDE Its not working right away -- is that possible with some trick
MT5 question. I want to build a system that gets in and out of 10 pairs at the same time. Q: When backtesting, am I able to set a custom spread for each of the 10 pairs, and a custom SWAP for each of the 10 pairs, that takes effect during backtesting? I need to be able to see that my multipair...
How can I remove those arrows autotrade history in backtesting, I am having a hard time identifying the backtest trades as it is cluttered by those autotrade history
Hi. I am trying to extract timeCurrent inside onInit() and onTick() to get optimization starting time and current time, but it returns 1970 when I try to Print these variables during onTesterPass or onTesterInit. Does anyone know what is the problem? Thanks
Hi, I just backtesting my EA and I saw an abnormal behavior in the graph shown below, After looking into the chart there isn't any particular trade that resulting in that drawdown. I looked into the journal log and found that after 2022.06.30 the strategy tester restart the equity of the strategy
MetaTrader 5 has the Debug/Profiling section on its Options at the taskbar. But the MT4 does not have it. So how to code debug/profile and have same or similar details and results as using the Code Profiler but on the MT4
Hi . Is it possible to set a time limit on the backtest ? I found an expert advisor who does not open a position even in the backtest from 2021 to today. Several people commented that this expert only opens positions based on the history that is placed inside it, and its strategy is fake, and it
According to the documentation of OrderCalcProfit , "The function calculates the profit for the current account, in the current market conditions, based on the parameters passed. The function is used for pre-evaluation of the result of a trade operation. The value is returned in the account
I need somone to build to me an expert advisor for my strategie based in martingale and hedgin . the role of this ea is to close trade at profite this depends on the number total of open trade in symbole '( ) for exemple : profit target = 10$ coefficient = 0,85 nombre of trade =1 profite on closing
When I want the effect: It starts when the profit reaches an increase of 300 points. If you hold a BUY order now, and every time the price rises by 100 points compared to the entry price, adjust the position of SL to SL+100 points. If you hold a SELL order now, and every time the price drops by 100
I am testing my EA using the strategy tester and I have been getting a wierd issue. This is for dec 12 3550 build. metatrader demo account I noticed that when I run the EA withought visual mode on, it missed trades. So when visual mode is on, it takes all of the trades. I narrowed this issue down to
Hi, I created an EA which makes trades if some conditions are satisfied and I'd like to optimize two parameters - the SL (in pips) and the risk-to-reward ratio - which do not affect those conditions. However, when I perform backtest, I see that for most of the combinations no trades are actually
This morning, I purchased an EA from a seller who promised to provide the settings and personal bonus by contacting him. I have left several messages for him. So far, no response. The product is practically useless without the settings. I opened a ticket with the service desk. Does anyone have
I have tried multiple approaches to this, based on the documentation and on information I've found in this forum, and I can't get anything to work. Simple version: void CloseAllPositions() { CTrade trade; while ( PositionsTotal () > 0 ) { trade.PositionClose( PositionGetSymbol ( 0