Expert Advisors and Automated Trading - page 314

Hey all, is it possible to cancel a OnDeinit request ? Like i have EA1 and EA2, EA2 has dependencies on EA1. For some reason EA1 is turning into a "OnDeinit" state, now i want to check if he is allowed to exit. OnDeinit is a void function which will have no return check and this also means the...
Hello, I am trying to use the ZeroMQ library in order to send information on a TCP socket When I use my first line of ZMQ code in my Expert Advisor... ex: Context context("PROJECT"); ...and try to execute, I am asked by MT5 the following: I accept but nothing happens after that, I can the the same...
void OnStart(){Alert ("Total buy order is ",GetOrderCount(ORDER_TYPE_BUY));}int GetOrderCount(long type)   {    ulong order_ticket;    int total=0; //--- go through all pending orders    for(int i=0;i<PositionsTotal();i++)   {       if((order_ticket=OrderGetTicket(i))>0)         { //if(magic_number...
hi everyone . i was building an ea and now im testing it. but the ea stop working when i log out from trading platform (MT5). is there any solution for this? Thank you
After the moving average crossed, Delay the third K-line alert。 e third K-line alert
Hi, I'm new in mql programming and trying to develop my first EA based on what I found in mql articles. The scope is learning because I've made backtests but I never got any profit :) For the code below I get next errors: 'CCI' - enumerator identifier already defined 'Stochastic' - enumerator...
Hello i need to draw support and resistance levels for my EA, i have looked on alot of S/R indicators but none of them quite does what i need. I need a code that draws a line when the price is being rejected 2 seperate times in 2 diffrent candles(A support or an resistance area/line) nothing...
Hi traders and ea coder, kindly share ur views on my strategy , intraday, 1) daily every new high buy entry, 2) daily every new low sell entry, 3) timeframe 5 min and 1 hour 4) stop loss previous swing high for sell  stop loss previous swing low for buy or  5) stop loss current day high for sell...
Hi All, Is there any way to calculate dynamic take profit in dollar for martingale postilion. If I have .01 to .05  - TP  should be 2$ If i have range from .06 to.1 -- TP should be 5$ if the range from .2 to .9 -- TP should be 10$ like that it need to go I was thinking  like this  --...
Hi guys I recently had huge losses while my signal trader made profit. It turned out that my broker closed my positions 45 minutes before the trader..  Now i'm lost because i don't know who/what is the responsible and how to fix that !  Did you have such a situation yourself please ? Should i change...
can anyone know how to run single ea with different parameters to multiple charts at a same time on vps
I am trying to notify users that they have turned off their Auto Trading. Is there a way to send an alert and a Print message when the Auto Trading is turned off in an Expert Advisor?  If so, where would I place the code? Thanks!! Eddi Rae
Hello,I have a simple question, did you know if it is possible to launch an order when anINCLINED support or resitance is affected?thanks for the answers .
This is a simple Expert Advisor for trading on EURUSD H1 market. Backtestet result: Trading rules: Long Entry - wait for a bullish bar with body > 30 pips and Volume > 2.0 * Average volume from last 80 bars. Open long at next bar Open and close at the bar Close. Short Entry -...
I have an EA that opens positions on multiple currencies with same magic number. I have another EA which closes a position according to certain rules, but the EA does not close the other positions on other currency pairs. Does anyone know of such an EA of when a certain magic number closes on the...
Hello Everyone, I am requesting guidance & assistance with basics steps to creating an array for a variable. My intent is to create a variable for a position's profit per candle, more specifically, I would like a position's profit for the last 3 candles. I will need to create an array right? & was...
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...
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...