Expert Advisors and Automated Trading - page 3

Hi, I've found 2 method to write a data to csv. The first one is to do it like this, void OnTick () { FileOpen (...); FileWrite (...); FileClose (...); } The other method is like this, int OnInit () { FileOpen (...); } void OnTick () { FileWrite (...); } void
Hi Does mql5 do all that for the market, or do I have to add something to the script? and if so ... how, where is info of this
I use MA50 []; and MA200 []; arrays for my expert advisor. if the EA is 24h in operation, the arrays also fill with Moving average data. so, should I reset these arrays once for a specific period to avoid calculation errors
I have an ea that is not passing inspection for marketplace. Can someone help me fix this
Hi, I created a TrailingStop ea to help to modify stop loss position. After that, my data provider is OANDA, the first position I opened is USDJPY.sml and second position is AUDJPY. However, when I run this ea with the code below, it fails to return second position AUDJPY, for both index 0 and 1, it
I am trying to post a pending Orderasync on a DEMO account but no matter i do the error persist. The symbol specification says Order Expiration : TODAY Here goes my code and tries: bool Trade_OrderAsync( double volume, ENUM_ORDER_TYPE MyOrderType, double Order_Price, double Order_Stop_Loss_Price
While working with multi-currency EAs, most commonly one has a unique EA that is applied over to multiple currencies. In theory, there is an infinite loop, running the same operations over data from multiple currency pairs. While studying how to do this, I came across three alternative suggestions
这是我的代码: // 输入参数 input int MagicNumber= 1 ; // 魔数(MagicNumber) input double Lots= 0.1 ; // 每个订单的交易手数(Lots) input double MaxOrders= 5 ; // 订单总手数上限(MaxOrders) input double StopLoss= 50 ; // 止损点(Take Profit-以点数为单位) input double
  Control the EA  (10)
Hi, can you control your EA so that when it's an uptrend he can only buy and downtrend he can only sell, is there anyone who can do it
Hi there! I´m coding an EA that should place a BuyStop / SellStop order at a specific price and if it doesn't reach this price it should be cancelled after 2 bars (10 min since im using it on M5 timeframe). I tried to do that by setting an expiration time but when I test it on the strategy tester it
can someone help me with adding a function to close open buy position when my two moving averages crossover takes place
@Lorentzos Roussos @Dominik Egert I was just trying to start with Matrix and Vectors, but reading this thread ( https://www.mql5.com/en/forum/448355 ) makes me think again. Tell me frankly man, is it worth to invest time in learning them? The documentation is very poor to explain the correct ways
Please anyone to Help my Mt5 is displaying unsupported filling Mode...What is the proble
been working on this inside bar expert advisor and i had issues with it giving continuos non stop alerts but tried to solve it but now it wont compile because of a unbalanced parenthesis on the "void OnTick(){" line 23 in the code below. can you guys please help me balance the parenthesis as i have
Hi I would like to ask some help in my search for the correct tick value. In both MT5 and MT4 the tickvalue is sometimes set in a different currency then the deposit currency. When you place an order and DRAG the order up or down to set TP or SL the "value" is based on deposit currency. See the
I'm getting complete opposite result when testing on every tick or 1min OHLC. the EA and input parameters are exactly the same but in the case of 1min ohlc I get 50000 profit while in every tick I get -7000 losses. this happens on many pairs testing on a period of 2 years 0811-0813 someone have had
So I have been watching a very interesting video series by Darwinex about improving your EA to reflect backtester results in live charts. It seems that the best method is controlling bar opening prices. You program the EA in a way that it processes only bar open tick so this will reflect on a live
does anybody has tried any EA trading of shares CFDs on OANDA? i tried but orders are not executing. if manually trading i get this in journal: but if a robot trying to open trade i get this: what could be the reason for rejection? the error code is 10006 i contacted the broker but they have no idea
I created an AI trading bot in MetaTrader 4 and 5. Implemented a Python script to use the AI model and integrated it with the EA using socket communication. Runs well for one forex pair. Now I want to increase my Forex pairs and trade with more pairs. So, I need to develop several Python scripts for
Hello everyone, I've been trying to create a code to count candles from the last pending order, so that after x candles of the pending order, it automatically cancels. However, I didn't get to the calculation, could someone give me a tip
I used this color codes as input parameters. The I used them to modify object colors . but it does not work. I checked the EAs input menu, all the colors are pre-selected to black. even though correctly declared them. input color Monthly_Resistance = clrCrimson; input color Monthly_Support =
Hello, I'm having trouble finding a good logic to notify me of each Open/Close event. My issue is that sometimes there are multiple Opens or simultaneous Closes, and I would like each one to be correctly notified. I'm thinking of using `ontrade()` - but I'm having trouble using this function
I'm copying a signal using 95% of my deposit and don't copy any other signals on that account. The signal's leverage is 1:300, mine is 1:500. I read the explanation for the calculation of relative lot sizes: https://www.mql5.com/en/forum/215636 Based on that explanation I would expect that the risk
Hello, I'm currently developing a system that initiates trades in the last 5-minute candle of every Monday. Ideally, most of these trades should hit the SL at the opening of the next day if there's been a bearish gap, as the SL is set at the lowest point of the current day. Upon backtesting, I
Hi everyone, I just started learning how to code yesterday so i'm fairly new to all of this. I'm sorry if this is a stupid mistake but here is the problem i'm trying to solve. input double MarginPercent= 300 ; //User input for the margin percentage the user wants to trade with input double
Hi, Stuck into a problem. Using the standard MoneyManagement modules results in OrderCalcMargin always returns true and margin 0. in AccountInfo it's that call OrderCalcMargin (trade_operation,symbol, 1.0 ,price,margin) which with further execution leads to the usage maxvolume of the symbol
Hello, I have been trying to validate my EA for two days without success and despite the checks carried out, the tests concluding in real and in demo always the same message: test on EURUSD, H1 there are no commercial operations test on NZDUSD, H1 there are no commercial operations test on
I need to check either sell or buy positions runs at a time, also, I need to check either buy stop or sell stop placed in the current symbol. if you can give me an example for this, I can learn from it
I was working to implement a EA that utilize trailing stop losses, when doing so there were frequent invalid stops errors in journal. I had some research in the forum and test different solutions but non of them worked, this is the routine I use to modify stoploss: if there is required change of
So I want to subscribe to, for example, 4 MQL5 signal providers and I want their signals to be sent to one MT5 account. I posted on Reddit and got an answer before the moderator deleted it. He said, "Run 4 MT5 instances in portable mode, one for each signal provider, log into the same account on 4