Expert Advisors and Automated Trading - page 52

Hello all, I get two different tick formats when using CustomTicksAdd and CustomTicksReplace with the same tick array input. The funcion CustomTicksAdd for some reason does not show the decimal point at the correct position in the tick history and Market watch in MT5. For example: FUNCTION <BID>
  Unresolved Static Variable?  (15   1 2)
Hi guys, can anybody explain, what that sudden error is supposed to mean? My EA was working flawlessly for months, but since the latest update, I get this error. In my EA I just declare an array CMoneyManagement mms[]; and CMoneymanagement has one static variable. Whats wrong with that...
Hello everyone, I'm currently developing a GUI using the CAppDialog class in MQL4. My application has the capability to save and load its state, including all GUI controls, to and from a binary file. I use the Save method provided by CAppDialog for this. The issue I'm facing is related to dynamic
if ( (MovingAverage1[ 0 ]>MovingAverage2[ 0 ]) && (MovingAverage1[ 1 ]<MovingAverage2[ 1 ]) ) if ( PositionsTotal ()== 0 ) { OrderSend (request,result); else if ( PositionsTotal ()== 1 ); CloseAllOrders(); }
Hi all, I am trying to optimize my EA with with different timeframes as input. Here is how I change the TF within the code, where Timeframe is the input: int OnInit (){ ChartSetSymbolPeriod ( 0 , NULL , Timeframe); ... Then in my code I simply use Timeframe wherever I need it (just in iCustom
Short Version Question - please help! : I cannot see (on scan) my LAN strategy testers (on my other computers) despite enabling network discovery and disabling firewalls. What else is there to try? My earlier, longer description: I can't believe I can't find a solution to this, so maybe I have
I am testing out iCustom with my own indicator which is a simple MA with arrow signals (long and short signals based on how the market price moves over the MA). This indicator is not to be used as an EA in live scenario as the indicator has no risk management features and it is not making exit
Hello everyone, I notice that when collecting historical trades from a broker with Metatrader 5 Backtesting, the speed of collection is very different if the collection dates are older or more recent: If the dates are old, the data collection is very fast and if they are more recent, it is very
Hello, Thank you in advance for ANY help I can get on this -- I'm not a newbie and this has me perplexed. I have a simple calculation I've always used to calculate dollars per pip (account funded in USD) and it has always worked on all forex and metal symbols at multiple other brokers. Now at a new
Hi, I have 2 problems that i can´t solve. I hope you guys can help me work it out. Problem 1: I have an EA that works fine on demo account. It places trades and the profitability is very good. I let it run all day on demo account and it works like it should. But when i switch to real/live account,...
  EA Buying Order  (3)
I have created a simple robot (EA) that executes an order which opens a position and then closes that particular position. After buying and closes the position the Journal shows an instant sell which I didn’t require. Please find below the Journal display, 2023.09.01 19:55:33.012 Experts expert
Hi, I have a stop order and want to save the new ticket after the stop order is filled. I tried to use OnTradeTransaction() class but failed to do so. Here's how I do it. void OnTradeTransaction ( const MqlTradeTransaction & trans, const MqlTradeRequest & request, const MqlTradeResult &
For some reason it doesnt update my trades with the new TP. Please help. double BAvgTP (){ double ask = NormalizeDouble ( SymbolInfoDouble ( _Symbol , SYMBOL_ASK ), _Digits ); double newbtp; double loss = 0.00 ; double Lsize = 0.00 ; for ( int i= PositionsTotal ()- 1 ;i>= 0 ;i--){
  Panel update  (2)
Hello i have ((account balance )) in my EA panel,But when open position the balance it does not really move with the balance unless I make an refresh manual,How do I make it move every tick with balance in the include file please. m_lMainAcc.Create( NULL , "lMainAcc" , 0 , 20 , 40 , 1 , 1 );
Hello i am experiencing a serious problem during automatic product validation testing, the robot is based on the US30_Spot and when running it in strategy tester , real account, demo account, no errors appear at all, not even warning and everything is operating perfectly when uploading the file and
Hi, I want to ask about selecting position by ticket function. My EA is multi-currency EA and I store each buy ticket and sell ticket to BuyTicket[] and SellTicket[] Array. Usually when I want to select a position I will use loop through all open position and select each position by the ticket then
Hi, Very odd anomaly is happening. In my backtest the EA trades as programmed, one trade per day, but sometimes it places two trades in live with in one second time difference and open price is only few pipettes apart. When I backtest the exact date of the duplicate trades, then it places a single
I always look at the chart and wait for the price to hit my target to place a market order. This is because my limit orders often don't get triggered due to the spreads. Is there a script to place a limit order as if it was a market order
Hello everybody. I would like to know if there is a way to access the entire trading history through the OrdersHistoryTotal() function. If so, how can I do this via code? Thank you in advance for everyone's help and understanding
Hi guys, I am very new to this platform so please bare with me... I have recently started building an ea using mql5. I have coded it in such a way that if the previous DEAL_ENTRY_OUT returns a negative profit value, the buy/sell will not be executed until a new bar has been printed. As part of the
Hey, i have strange issue, when my tp is rising, acc equity also Then when tp is reached im closing positions (both types, BUY and SELL) And now when positions are closed, total profit is decreased as on attached pict: so i know it is tester and generally logic should be ok, but i dont want to show
Good day, I am experiencing an issue with the stability of my EA/ EA's. It appears to become Unresponsive after X amount of time being attached to the chart. By unresponsive I mean that the EA has been left to run on its own, without interference, and after X amount of hours I am still connected to
I am trying to print the history symbols are type along with date however the results are completely messed up time of deals are not matching the history ,tickets, type of buy and sell are not matching (i assume it return 1 for buy and 0 for sell) can anyone check my code and tell me what am i doing
Hello, I am trying to implement the main prop firm rules within my EA: - stop trading when 8% profit reached - stop trading when 10% loss reached - stop trading for the day when 5% drop from the equity at the opening of the day. I have the following code to save the equity at the opening of the day
//--- Include standard libraries #include <Trade\AccountInfo.mqh> #include <Trade\PositionInfo.mqh> #include <Trade\SymbolInfo.mqh> #include <Trade\Trade.mqh> //--- Classes CAccountInfo AccountInfo; CPositionInfo PositionInfo; CSymbolInfo SymbolInfo; CTrade Trade_A; input uint
Hello, I am new to programming and wanted an answer to my following question. In mql5 the instructions in the Ontick function are executed at each Tick. is there a way to take the price value (bid or ask) at a given time and store it as a reference value to use it later in the program. for example
For an MT5 demo account on [Redacted] I try to use mql5 to retrieve the account number using " AccountInfoInteger(ACCOUNT_LOGIN)" and as can be seen form the attached screenshot instead of getting my account number 3000051923, I am fed back with a negative number that does not look like any account
Hi, When using the strategy tester for optimisation, is it possible to ignore certain combinations? For instance, if I optimise the below parameters (example), the tester will test all combinations even if the first parameter is false: For example: Ideally, I only want combinations of Bollinger
Hello everybody. I developed the code below to return last month's profits. For some reason beyond my knowledge, the returned value is different from the MT5 one. Could someone tell me where I'm going wrong? //--- double GetProfit() { double profit = 0 ; //--- int timeDay = 24 * 60 * 60
Hi all, I am trying to partially close my position once a certain risk reward is reached. Both proportion of the position to be close, and the risk reward needed to be reached are inputs. I am struggling regarding the volume, as I want the partial cloture to happen only once, so when the volume of