Expert Advisors and Automated Trading - page 100

To post a new topic, please log in or register
Is there a way to read some recent history and feed some signals to expert at initialization? The problem is - Every time I reopen terminal expert's signals are clear, so it can't trade until it fills its signal registers fully. And it could take loooong time especially if you get your signals from...
HELLO, Am new to MetaTrader; How should I modify the "Moving Average Expert Advisor" so as to (1) Signal (buy/sell) INTRA-BAR other that at close (2) Signal only ONCE PER BAR (3) BUY ONLY and/ or SELL ONLY but not both Thanks...
Does anyone know if there is a way of sending a user a message on MT5 mobile without the MT5 terminal and EA being switched on? Thanks in advance
Hi,  I want to create a function to move stop losses, But I constantly get OrderModify Error 1. Can you help me? void increment(){int incB=0,incS=0,tkt[];double stoploss[];ArrayResize(tkt,OrdersTotal());ArrayResize(stoploss,OrdersTotal());bool incrementBuy=false...
Hello. I have problem with my simple EA. Robot should open position when bar is bigger than 30 pips but he opening positions very unclearly (after only 3 pips) and i don't know why. Anyone could help?? #include <Trade\Trade.mqh>CTrade          trade;#include <Trade\SymbolInfo.mqh> CSymbolInfo...
Hi all, I am using BollingerBand in MQL5. When I copy values in buffer using CopyBuffer function, I got Un-Normalized values, which contains  more then five decimal places. Moreover I explicitly tried to normalized them using NormalizeDouble and DoubleToString methods but both of them some time...
Hi all I want to calculate pip difference between two  prices using mql5. please guide. thanks.
I'mtrying to get an alert to include the time frame the alert has gone of in. Iget an error saying the number to string conversion and the actual alert saysBuyNZDUSD16392 (the numbers are the conversion but how do I get it to say H8 orH12 D1) I tried PERIOD_CURRENT this did not work 
When testing my EA, I found some strange behavious of the tester: In 2017.04.24 01:02, when there apears a big gap in EURUSD M1 chart, my EA opens & closes some orders at prices that shoul NOT exist. Even when I set the tester to run in "fatest mode with open price only", it still interpolates some...
Hi All, I am trying to use the CPositionInfo object to return information on an open position. However, it does not return the expected values. Here is the relevant code: //declarationclass CSampleExpert        public:        CPositionInfo     m_position;//buy statementif(m_trade...
Hello everyone,  Can somebody help with this request: I want to change the % risk at each trade from 1 to 5% for example and back to 1% or the half of the last %risk following the winning rows and losing rows. like first winning 1%, second 2% till 5. If loser I will decrease by the half of the last...
Hi, I'm writing an EA that will mostly use daily updating signals (i.e. market data is PERIOD_D1) but the EA will then select an appropriate time intra-day to trade (i.e. will need to make a per tick decision, until the trade is made) There is clearly no need to update the daily signals and daily...
Hello, i have some question to the CopyTicksRange function general, im not clear between the datetime vaules in seconds and milliseconds MqlTick  tick_Range[] , tick[] ;    int copied_Range , copied ;        datetime Start_date = (TimeCurrent() -10000) ;    datetime End_date   = (TimeCurrent()...
Hi, I'm trying to write the simplest EA in MQL5 and it's really not a fun experience. Firstly I tried to write the EA from the ground up and find it incredibly cumbersome to do even the simplest things, for example to get a couple of prices:       // get yesterday's open and close price...
Hello all: Ive been using mysql for working with my EAs for some time now, I used mainly this EAX Library https://www.mql5.com/en/code/855, which I added a couple of functions and some error handlers for reconnections in case the connection gets dropped while executing a query, everything works...
Hi there, I have EA's working since Jan 2013, compiled back then OK, and running in market without problem since. However re-compile same Jan 2013 code with latest MT5 compiler, gives me errors in market. Code has not changed. I traced it to maybe the CTrade::FillingCheck. This EA is using...
Hello, i want to know the actual time in sekonds since 1970 as its written also here in the output format https://www.mql5.com/en/docs/convert/stringtotime i try to use  Print( StringToTime(TimeCurrent())); but as output in the terminal i always get the format YYYY.MM.DD hh.mm.ss does i do something...
I want a event that trigger always when a position is closed by SLTP. I found nothing native from MQL5 to do it, so I'm trying approaches to do myself an OnSLTP() function. A piece from my code to do it uses the history:     void ProcessClosedPositions(){       datetime now = TimeCurrent();...
Hello everyone, First, sorry for my english. I discovered a very good renko chart Indicators. I like it because I don t need to used offline chart. It s Renko_2, you can find it here : https://www.mql5.com/en/code/9839 There is a problem with it, like an indicators, it works when the Japanese...
Hello, Im trying to get my last deal profit, that means that if I lose I get a negative number and if I win I get positive number. I wrote the simple code: HistorySelectByPosition(last position ticket);Print(HistoryDealGetDouble(HistoryDealGetTicket(0),DEAL_PROFIT)); but all I get is 0.0, always....
Hi all, I am using BilingerBands in my EA but it is returning very big value as follows which is definitely not correct. 9.881312916824931e-324 Following is the code of OnTick method: void OnTick(){   //-Sorting array from current candle downward..   ArraySetAsSeries(lowerBollingerBandArray,...
Hello I am would like to attached RSI 14 and RSI 7 into same windows. So how to do that and how to specify this in the code!! Chaiya
I know there is a maximum to how many notifications I can be sent at one time. Is there a limit to the number of simultaneous alerts you can receive? I am asking because I created an indicator to send an alert to my computer and a notification on my phone if certain conditions are met. I am...
Hello Everyone!, I'm at the end of my rope and need help please. I have searched MQL5 forums and google, didn't understand MQL5 manual documentation Getting Errors and not able to move forward - please help (journal & mq5 files attached)              // Alert: The Sell order request could not be...
First of all, I'm sorry for my bad English. I have an EA. If price doesn't touch the T/P in 20 mins, that order must be stop at current price. I don't want to wait for the price to touch the S/L. Is there any code about this?
Hi, I'd like to know the spec of the vps provided by metaquotes. I've searched across the site, but no answers. Thanks
Hey guys, need some advice. If i set a minimum and a maximum for an indicator in its own window, i can do so either in header or inside OnInit(). In OnInit() i do so using  IndicatorSetDouble(INDICATOR_MINIMUM, 0.0);IndicatorSetDouble(INDICATOR_MAXIMUM, 100.0); Now if i later need to remove those...
Hi guys I do have a problem with my buyflex function, following the log 2018.04.30 03:05:34.715 2018.01.23 17:10:19   failed request buy 1.00K 2 at 18.29000  sl: 18.14000 tp: 18.42000 [Invalid request] 2018.04.30 03:05:34.715 2018.01.23 17:10:19   Function: BuyOrderFlex99 Error: 10013 Invalid...
I read the article "How to Exhange Data: A DLL for MQL% in 10 Minutes." I followed the instructions, and now have a working DLL with all the sample functions of the article. I need to add a new function similar to this one (from the article): The C++ code: _DLLAPI void __stdcall fnFillArray(int...
I'm not getting the correct characters to display for the corresponding keystroke events. For example when I press the "," key I get "1/4". Am I doing something wrong? Here is my sample code: #property strict#property...