MQL4 and MetaTrader 4 - page 525

To post a new topic, please log in or register
I am trying to delete pending orders but the pending orders won't delete. The EA  is eg: When the Buy criteria to "Open" is meet place a Buy at Market and place a  pending order. When the Buy criteria to "close" is meet then close the open Buys and pending order should be closed. Short Trades same...
My EA is set to EachTick, but my objects does not update values/location when orders gets opend or closed. my code structure as following: int init(){WindowRedraw();ObjectDelete ("MyLine");}int deinit(){WindowRedraw();ObjectDelete ("MyLine");}int start(){WindowRedraw();ObjectCreate ( "MyLine",...
Hi, If I draw a horizontal line on W1 and switch to anyother time frame it disappears, on the time frame I switched to and also W1 - this is reallllly annoying... Any ideas if this can be done? Thanks mcia
Hi, it took me hours today but as long as I had Symbol() in the deinit() function (in order to delete a market specific file) my terminal (build 509) seems to run into an endless loop with max cpu-time consuming - anybody who can confirm? As soon as I replaced Symbol() by a global var SYM set at...
Hi there, i recently restarted programming MQL4 and made myself a Trailing Stop EA. Sadly the following version, which shall "trail" the Stop Loss depending on the Highs and Lows of the 3 most recent closed candles does absolutely nothing when activated: int init(){   return (0);}int deinit(){...
Hey All :) New quicker question this time! How can I tell "Close[1]" to be focusing on the 4 hour time frame, irrespective of the time frame I am currently looking at? Close[1] > Hour4_60 // EMA -//- I want that Close[1] to be the close of a 4 hour bar? Many thanks as usual!
Is it possible to Create Specific color for some Print statements that show in the Experts tab ? To highlight some print statement to find easily. Thanks
Hello Apologies for another really dumb question, but its beyond me! In my EA, I'm collecting and writing data into weekly Excel spreadsheets, which I'm incrementally numbering, creating one new sheet per week. This is fine, but I end up with spreadsheets all named as numbers only. I'd like to use...
I have seen here at many places refer http51.dll but where is it ? Where can I find the source code ? I tried surfing through the complete code-base but no luck. Hopefully, someone can help.
  Help with ADX (16   1 2)
I dont know but i guess ADX indicator has no fixed marginal limit between to move like stochastic or rsi.My problem is that i've set up a setting where it will only take trades if ADX>50 and it wont work it will take trades whenever it wants even below the preset 50 level.But if i set a value like...
Hi guys, i'm searching with an EA in all Forex Pair for special conditions. If the EA says yes, i want to open a chart of this pair und put an arrow inside. Is this possible? I can't find something like this. The problem is there are 5-10 results and i don't want to open them by myself and put an...
Hi, I have an EA that worked in back testing. However, a part of it failed in live trading. When a level is breached, it supposed to close a short and open a long. Although, it's doing so in the back tester, it failed to open the long in live trading today. I added the print function today, to see...
Hi, I would like to know how can I find an indicator window with mql4 where more than one indicator is attached, like on the screenshot below. There is 3 different RSI in one subwindiw, but WindowFind() does not work for "RSI(14)" and "RSI(21)". Thanks.
I would like an Indicator to do the following Horizantal lines 1000 pips range then 4 quarters of 250 pips then half the quarter with 50 pips above and below. then to do that on all the charts I have attached a pic for you also the Indi should do example GU 1.5000 - 1.6000 - 1.7000 should show...
  basket pips (3)
I'm trying to tackle an area re: basketpips I'm not sure if i ought concern myself with pipvalue at all. i.e. http://www.earnforex.com/pip-value-calculator Account Currency AUD Currency pair AUDJPY Position size, units 100000 Current AUD/JPY 87.672 Price of pip 11...
I need an very simple and easy ea wich is opening every 100 an buy trade and every 200 and sell trade ! But I am a very noob when it is going near to programming something maybe someone helps a noob ( I will be very pleasured in your help ! Kind regards Nikita
I would like that the maximum slippage for the OrderClose function to be the distance between the current price action and the preset STOP LOSS I set it like this but it doesnt work,it gives me an error 4051 for invalid slippage please help: FOR BUY:     for(i=0; i<OrdersTotal(); i++)   {...
everyday I want to get high/low value for first candle.ie. 00.00AM I tried with 4hr TF: But shows different candle high/low.i valdiate date with nday!=Day(); Please help me to fix the issue. #define  ZEROAM 00    int shift=iBarShift(NULL,0,ZEROAM);    hval=iHigh(NULL,0,shift);    lval=iLow(NULL,0...
New article Building an Automatic News Trader has been published at mql5.com: This is the continuation of Another MQL5 OOP class article which showed you how to build a simple OO EA from scratch and gave you some tips on object-oriented programming. Today I am showing you the technical basics needed...
Assume ! my interrest separate windows is number 2 ( Total separate windows = 3). How about code for self get this separate windows? thank you
I want to play sound when: 1. Pending order active>>sound1 2. TP reached>> sound2 3 SL hit>> sound3 int start()  {   int    counted_bars=IndicatorCounted();//----   temp = 0;   for (int i=0;i<OrdersTotal();i++)   {      OrderSelect(i, SELECT_BY_POS);      if (OrderSymbol() == Symbol()) temp++;...
I downloaded the latest build of MT4 (509) and tried to use the strategy tester offline with tick data.. It reads the EAs that are EX4 files but does not seem to read the EAs which are MQL4 files. Is there something I am doing wrong?
Hi!! Any one please help me to find this problem; when i use iCustom to call "FXA0 - RSI Crossing 50 plus ATR ver1[1].2" indicator only 0value return to me at all time. double RSI=1; RSI = iCustom(NULL, PERIOD_H1, "FXA0 - RSI Crossing 50 plus ATR ver1[1].2", 0.15, 21, 21, 2, 0);
Hi, the idea: start a function on Saturday or Sunday when the market is closed that e.g. investigates the performance of a (each single) system or of all together in order to e.g. change the parameter that e.g. calculates the lotsizes for the next week. The start()-function is started at each...
Hi all: I just notice that on MT4 platform, there is always a Sunday's "small" bar which is usually considered as part of Monday's market behavior. Is there any way to absorb the Sunday's bar into the Monday's Bar please? Thanks
int TrailingStop[10];int init()  {  Print("+++++ init done");  string s =DoubleToStr(TrailingStop,0);  return(0);  }int deinit() { return(0);   }int start() {  return(0);  } compiles well on compile time, but throws error on runtime: EURUSD,H1: invalid double number as parameter 1 for 'DoubleToStr'...
Hi all, I need to get the number of orders that have been closed. Could you show me how could one get that from order history ? thank you in advance for any support provided Luis
Just a snippet of information that I have not seen written into the documentation it might be useful to someone when debugging. I accidentally declared a variable both globalscope and localy it works in the following way. If a variable is declared globalscope and a variable of the same name is...
Hi dear noob brothers (and other). I've been suffering from this "unbalanced left parenthesis" from time to time and wanted to share with you an article I've found here, on how to find them in a more comf. way: https://www.mql5.com/en/articles/1547 Enjoy.
Hi, My code for adding Martingale money management to include in the lotsize calculation works in the tester but doesn't appear to work in a live account. (Please note my code isn't the prettiest, or possible the most efficient, but it did seem to work in tester, so appologese for posting so much...