Expert Advisors and Automated Trading - page 155

Hello, I have a function which I use often in my code. I would like to know if there is a better/more efficient way of doing this. Any suggestions are welcomed. //+------------------------------------------------------------------+ //| NormalizePrice()
Hi! I need to get the low and the high of the candle where a script is released. I remember there is a function but i don't remember the name. thanks
Hi everyone, I have an EA which uses a daily timeframe for trading but also uses a weekly timeframe as a filter. When testing the EA I noticed that BarsCalculated returns -1 (No data). After playing around for a bit I created the following code to test this out further. The behaviour is different
Hello, I find an Error during backtesting as shown in this pic While: void ModifyBuy ( string Symboll , double StopLoss, double TakeProfit ) { for ( int posIndex= PositionsTotal ()- 1 ; posIndex>= 0 ; posIndex-- )
Hi, I was running a script on MT5 using the python library. Everything was running ok until the mt5.copy_rates_from_pos method suddenly stopped working. It returns an empty list. Other methods like history_deals_get...etc are working just fine. I have tried the following: Disabling Antivirus
  EA  (1)
I need help I want to know if it's possible to start 2 EA on two account on the same laptop. And how we can do it
  Rsi levels  (3)
Hi, i want to add RSI to my EA, with different Rsi levels than default. I'm adding RSI with this code: bool CSampleExpert::InitIndicators( void ) { if (m_handle_rsi== INVALID_HANDLE ) if ((m_handle_rsi= iRSI ( NULL , 0 , 14 , PRICE_OPEN ))== INVALID_HANDLE ) { printf (
https://github.com/CaneRandagio1983/adx-ea as in object, when I test "only" this ea, the strategy tester stops shortly after the start, without errors. executes the moneyManagement.setLotsByStopLossAndRiskPercentage () function, called by the buy () function and then stops could you help me
It's not the first time it happens. Wrong price is used instead of the right one, resulting in an enormous loss in the backtest I don't think my code is wrong, because error comes and goes. BTW it's an OPEN PRICE backtest I restart MT5 and error is gone
Hello everyone, How can I limit my BuyStops placing every single tick till the order is filled? I have a code where I have a Buy Stop placed at the high[1], and every time there is a tick I get placed another BuyStop at the same high[1]... I just want it placed once. Thanks in advance
Dear Form Member i would like to write Counting Last highest and lowest candlestick please advise code with thank
As the title. I'm using a EA that opens and closes trades At first i thought it was a weird coincidence. However, if i leave the settings and the VPS it will open the odd trade here and there. If i go in to MT5 and sync the settings with the MQL5 VPS it seems to wake it up and make more frequent
Hi, I have a little problem. I have a RDP VPS and installed there MetraTrader5 and logged into 3 different accounts from the same broker. Now I want to run my EA on all these 3 accounts simultaneously. I already activated automated trading in MT5 and unchecked the two "disable automated trading when
When this expert advisor was back-tested using tick-story dukascopy tick data with 100% tick modeling quality the profits were significantly higher compared to the mql5 data with 100% tick modeling quality. My confusion is which back-test is accurate. back-test Method: Every tick based on real ticks
Hello there, there's a function in MQL5 that can accept struct parameters, it's DatabaseReadBind bool DatabaseReadBind ( int request , // the handle of a request created in DatabasePrepare void& struct_object // the reference to the structure for reading the record );
Hi, when using the mt5 strategy tester in visual mode, sometimes the trades are displayed on the chart, so that it is easy to see entry and exit points. However, sometimes these lines and plots aree immidiately deleted from the chart. They print shortly, only to be deleted again. Does anyone know
Dear MQL5 forum i am the very new in mql5 coding please kindly advise me the step to improve EA coding
what's wrong in this code? if ( ( (adxStatus == bull) || (adxStatus == neutral) ) && (isADXForSell == true ) ){ adxStatus = bear; isADXReady = true ; } else if ( ( (adxStatus == bear) || (adxStatus == neutral) ) && (isADXForBuy == true ) ){ adxStatus = bull; isADXReady = true
Hi All, I'm using the boilerplate code to create Horizontal line without any trouble in the main chart (snippet below), but can't figure out how to get them to draw in the RSI window. I assume it has to do with Chart ID, but I can't figure out how to find the Chart ID of the RSI window. Any help
Hi guys... am trying to code a breakeven with take profit as 1pipette for currency pairs with 5 digits also for currency pairs with 2 and 3 digits. Thanks
Tried searching for others with this issue but no luck. I recently finished converting my MQL4 EA over to MQL5 so that I could use the MT5 Strategy Tester for backtesting. Initially I'm pretty certain it wasn't doing this, but now no matter what I set the 'Deposit' setting to in Strategy Tester
Hello, I'm looking for an EA that autotrades off the renko charts. Any leads you may provide, it would be greatly appreciated. Thanks
Is it possible to optimize multi time frames with the MT5 strategy tester
Do i have a knot in my brain, or is this bug? Since today (never had this problem before), i get many requotes from the tester, where the price differs of just one point from the request, while the deviation is set to 10 points. Do i really have to loop and retry until the diff is greater than the
Hello, I made an EA for ES and am trying to optimize some of the inputs across all my appropriate MarketWatch symbols/tickers. For some reason I cannot select inputs to optimize. When trying to optimize using only one symbol, I can readily select inputs with start/stop/step. Am I asking the MQL5
I made a BOT that uses basic scalping strategy, without too many complications, it’s my first bot. But it stop and does not know because it stop, and does not always brake at the same time, level, is always different
Hi guys... i'm new to mql5 and programming generally and would love for assistance to these codes.. ...this is how far i could go #include<Trade\Trade.mqh> void OnTick () { } i know some functions required like ordersend(), ordermodify(), orderopenprice(), orderstoploss()
Hi, I'm working with the WinAPI functions and I want my code to open the folder containing the Experts Log. Does anyone know the code to use in PostMessageW to reference the Experts Log? Does a list of these codes and their commands exist anywhere?    I have a script (below) that will do this with...
Hi, I was "playing" with hedging to explore possibilities : it's very tempting, since it allows purely & simply to recover from a bad position taken. The risk of these strategies is well-known : lot management. Comes ALWAYS a point, where the margin is stressed, the logical solution being to accept
[Deleted]
Hi everyone, I have a question, the below function can open 1 sell stop and buy stop when trades number is set at 0. But when I include the function in time and date to open trade at specific time and day of the week, it opens multiple trades what might the issue? void StopTrades( string symbol