Expert Advisors and Automated Trading - page 71

i'm using this code to test output flags of received historical ticks to a text file #property version "1.00" int OnInit () { //--- EventSetMillisecondTimer ( 44 ); //--- return ( INIT_SUCCEEDED ); } void OnTimer (){ EventKillTimer (); MqlTick receiver[]; datetime since=(
  Get Order Status  (1)
How to get an order status (I want to check an order has already closed by Take Profit or not) using HistoryOrderSelect() in MQL5 ? Thanks
Hello, I am fairly new to script writing as a whole in this regard. Hence this may be some minor user error on my part. However the attached script is meant to auto update the SL of all my current open positions. However when using the predefined hotkey that I have assigned to it. The journal
I am building an ea, i want to use either candle low or the Sar low below the candle.. If the Sar indicator value is not there available below the entry candle. The stop loss should be previous candle low. I already coded for trailing sl as per SAR value but Finding it difficult to code this
Hi all, i need to stop an EA by code if some condition occurs, as example if the time is <00:10 or >23:50. Could you please suggest me some code for that ? Thank you
hi, I'm getting this error: '==' - illegal operation use moving average cross strategy.mq5 170 18 when using this: if (holding == bar[ 0 ]) { trade.PositionClose( _Symbol , 5 ); } with this MqlRates bar[]; ArraySetAsSeries (bar, true ); int start_pos_b=
I have an expert which I back tested a couple of days and exported the results which included profit, swap and commission etc. Today I made a change to one part the code which shouldn't have affected the results and re ran it and exported the results. When comparing the net equity curves I noticed a
Hello. There is a simple code. The idea is next, trading volume will increase after there was a losing trade to recover losses. What I am trying to do is that if for example trading volume was 0.01 and there was a loss trade, it becomes 0.02 and resets once there is a winning trade. The problem is
Hello, I am struggling with some OOP coding in MQL5. 1. Besides I am asking myself if I should used the standard library (the expert classes) because I am not seeing many people using them ? Are there recommendations (using DoEasy library or make my own ?) Thanks you for your replies 2. before
Hello. I'm pretty new to this EA stuff and I got a question. Recently, when I was testing a strategy on demo I noticed that history quality was very red (20%) even though the other results were great and ended up with nice profit! So my question is: how the history quality can affect my future
Hi all. is there something wrong in this code? It was passing automatic validation before, but now it is not. Nothing else was changed, if I recall correctly. request.volume= round (request.volume/ SymbolInfoDouble (par_temp, SYMBOL_VOLUME_MIN ))* SymbolInfoDouble (par_temp
Hi, is it possible to change a pending order to a market order? I tried to do it, but I receive a "no changes" return. Thank you
Hi, Is there any expert or script where I can place pending order and it will trigger order as market order. Required this because some brokers don't allow placing pending orders near market, so the expert/script will allow me placing the order and will trigger it as market. Thank You
Hello everyone! This is my first post here so please don't roast me too hard if I'm going against any conventions here. I'll try my best. I'm currently trying to place pending orders using MqlTradeRequest. Since I can't seem to put MqlTradeRequest objects in an array I created a struct mirroring the
Hello, I could not find the information about this in the documentation, my question is, what do the following columns correspond to exactly
For example, below are my trades Trade 1: -100$ (lose) => loss_count = 1, loss_amount = -100 // Identify the first loss and assign it into loss_amount var Trade 2: -200$ (lose) => loss_count = 2, loss_amount = -300 // 2nd loss, negative profit will be cumulate loss_amount++ Trade 3: +100$ (win) =>
Hi, I was hoping someone could point me in the direction of where to read up on this or if it is even possible but essentially I want to create an ema of lets say 21 period. Then run a test using strategy tester and figure out the average pip deviation from the band over a 2/3 year period. I
I'm getting this error. A 'OrderSend' - wrong parameters count built-in: bool OrderSend(const MqITradeRequest&, MqITradeResuIt&) deprecated behavior, hidden method calling will be disabled in a future MOL compiler version 'OrderSend' - wrong parameters count built-in: bool OrderSend(const void
How to export transaction records generated in strategy testing visualization? Or in which directory can I find these transaction data
Hi I various EAs, and would like to put them all in a EA, but have realized the problem of closing the orders ... how can I do that without closing the orders of another EA
hi I don't know if this is related or not, but I know I have some stokers, and when uploading the mql5 to the market, this error keeps appearing File contains native code Allowed extensions .ex5 I'm not using native code .. so don't know what to do ... I just compiled it with the cloud service
Hi, I have an EA and whant to sell it in the market. I'm not sure of what license I have to add, or eaven don't know if I have to add one. I've read this . But still have q's. Can some one help me deciding please
Converting from MT4 to MT% Usually in MT4 I backtest in Visual mode and can drag an indicator from the navigation tree and use it on the visual backtest. This allows lots of on chart event functions. So far I can not replicate this on MT5 Anyone know how to do this in MT5?
How can I find out what is wrong with my EA? for the purposes of rectifying? 2023.06.26 17:19:01.642 Trades '70759879': requote 1.09109 / 1.09109 (instant close by 1 EURUSD at 0.00000) 2023.06.26 17:19:01.643 Scripts script FCK_EA_V1.5 (EURUSD,H1) removed
  Open parenthesis expected  (13   1 2)
I'm getting this error with this piece of code: double StopLoss=NormalizeDouble(OrderGetDouble(ORDER_PRICE_OPEN)-(OrderGetDouble(ORDER_TP)-OrderGetDouble(ORDER_PRICE_OPEN))*(AutoStopLoss/100),Digits); But I don't see the mistake, anyone can help?
I did the optimization in the period of 201901to 202101 and I forward tested in half like 201901-202001 and 202001-202101. And the result in 201901-202001 was good , but 202001-202101, the result was bad. And I did the forward optimization for 202001-202101, and I found the profitable value for
Hi, Could someone please help me figure out why my code is not generating an excel spread sheet as intended. The rest of the code I will correct later, however i need to generate an excel doc first before proceeding further. #property copyright "Copyright 2023, MetaQuotes Ltd." #property link
The search box on my mt5 IDE no longer appears as in the image. How can I get it back
If I am using MT5 with a non hedging account, and I would like to partially scale out of a current position how is that handled since a non hedging account won't allow orders on the server in the opposite direction of my current position? Any info is greatly appreciated as I am about to hire a
Hi all. I am trying to workout how can I get this "3" that I see on the symbol specs on my broker. But SymbolInfoDouble Symbol Magrin Initial returns 0.0 SymbolInfoDouble (par, SYMBOL_MARGIN_INITIAL ) So I ran them all and displayed as comment to debug: Hints += "\nMargin Hedged : " +