Download MetaTrader 5

MQL4 and MetaTrader 4 - page 202

To post a new topic, please log in or register
I am trying to create an EA that opens a buy order when the price moves up one tick and a sell order when the price moves one tick down.    double tickCurrent; double tickPrevious = tickCurrent; tickCurrent = Bid; if (tickCurrent > tickPrevious)   This is what I have but it doesn't work. 
When testing out my EA over various periods of time, the strategy tester will say testing M15, testing M5, testing M1 and then start running my EA. I'm wondering on what basis does it decide what data to use as your test data? For example my OnTick() data will be different if it uses M15 as opposes...
Hello, I got a problem with my broker and it connect my MT4 client to slower server than faster frequently. I fix it manually when I see it, but most of the time I'm not behind the PC. Is there a way to control these disconnections with MQL4 code ? These disconnections make lot of trouble because of...
Does anyone here tried to use CTable from mt5 on mt4? Thanks...
Hello, I trade by MT4 for years, and it is fantastic software, better than any other ones. Now I am confused how to backup my analysis history?  As many users, I used to mark some lines onto graphics of MT4, but how can I backup them? I knew MT4 recorded and stored them automatically, but If I...
Hi Guys, I am parsing a series of rates and then copying the .Open part into a new array, this is done via:    MqlRates rates[];   double copyrates[100];   ArraySetAsSeries(rates,true);   int copied=CopyRates(Symbol(),0,0,100,rates);      for (int i=0;i<=(copied-1);i++)  //0 to Copied-1 means that...
In the following code im trying to simply create keltner channels but i cant see why it doesnt display the upper and lower lines on the chart.  input int Keltner_Period=20;input double Keltner_ATR=1.5;input int Keltner_MaMode=MODE_SMA;// OnTick() event handler                void OnTick(){   double...
Hi Guys, I am writing a simple loop through array elements as a .dll. Using #import "Path" as usual but I am unsure as to hoe to declare the function and then call it. I am using: declaration: int arraytest(int a, int b[]);#import Call in an Alert whatever this function returns: Alert(arraytest(5...
//#include <xDebug.mqh> what this expression mean and what the advantage to put it in mql4 program  ? as am new and trying to learn thanks 
My EA works with all terminals except base currency GBP. one of my client using base currency as GBP, ea not working with his terminal. i tried strategy tester, which shown price calculation error! i change base currency as GBP, then startegy tester works fine now. but no live trades working? how...
A few months ago I was browsing the Internet, actually been looking for anything, but then I was interested in an article deeply. It was  an Abitrage EA for the Forex market. This tools trades the price differences between 2 brokers. <Advertising Removed> 
DEAR SIR, THIS IS MY CODE, This code is not working int start()   { fifteen_minutescall(); return (0); } int  fifteen_minutescall()  {    string fileName = "C:/abc.txt" ;            int fileHandle = FileOpen(fileName,FILE_TXT|FILE_SHARE_READ|FILE_SHARE_WRITE);                Alert("Added!");...
Hi iam beginner at coding And iam working on hedge ea  I will give an example for what I need : I have an open sell order , I need to set a buy stop order above it with 30 pips  So I need to get my sell order open price then add 30 pips on it  And the result will be my buy stop entry price...
Hi im pretty new to trading in General and Metatrader4. I was wondering if there is a way to get live OTC charts on the weekend with a Demo account? thanks
What is the good way to detect if a symbol is existing?  E.g. How to detect if "EurUsd.Pro" is existing or not? 
Hi all, I'm coding an EA. I have a global scoped variable. The pseudo code looks like: bool hasDoneSomething = false;int OnInit(){blah blah}void OnTick(){  if(! hasDoneSomething) {    hasDoneSomething = true;    callAnotherFunction();  }} I loaded the EA on the chart, it works fine and...
Hi, Since the update of the MT4 Build 920 version all my EA crash MT4. I use Windows 7 (64 bits). Could you check this problem with this version of Windows and fix the problem? I have an other computer with Windows Vista Professionnel (32 bits) with MT4 Build 920 and the EA work fine. I think there...
Dear everyone,   Anyone know what is wrong with the following statement?  Comment(Symbol());   When I compiled, it says "Symbol'-ambiguous call to overloaded function with the same parameters.". Or is there a way to write code to store the value of Symbol()?   Thanks you in advance.
Since installing build 920 my .hst files are being corrupted every 2 or 3 strategy tester back test (5 yr.) runs, and I have to re-import the .hst files. This happens even with the PC disconnected from the internet.
In the following code im trying to create an indicator that writes the previous days close, high and lows so as it displays all previous days on chart at once instead of only one at a time.  The code below writes close, high and low okay but its only for the previous day.  I cant figure out how to...
Hello Everybody, At the last few months i am experiencing a lot of problems with my MQL4 codes, EAs and indicators, each time metaqoutes releases an update. The first time i post a comment in the forum and in the help desk but it didn't help at all, so the second time i didn't make the effort. Now...
Hi, I would like to make an EA from an Indicator, and my problem is: the indicator paint an arrow and make alert, how can I capture the paint arrow. I tried iCustom, but unluncky, not got results. Anybody can tell me with example how can I capture the arrow paint?
Hi, short question to appreciate, i usually use: double d_someValue = 0.0; for initialisation. is that equivalent to double d_someValue = 0.; ??
Greetings everyone, in a few of my previous posts I've managed to slander a bit on the built-in strategy tester in MT4 platform. I decided that before I continue in doing that, I'd like to first give it a very good tryout so I started it up and was about to let it run an EA of mine. That's when I...
Hi hope someone might be able to help. Can you suggest a fix for the attached indicator please.   I want it to draw a Histogram for: SetIndexBuffer(6,HeikenAshi_tenkansen); SetIndexStyle(6,DRAW_HISTOGRAM); It will not do this. However if I set it to draw and arrow with extra setindexarrow function...
My computer (system 7) sounds fine until i turn on mt4 (version 4.00 Build 920)  Was fine until a couple days ago. Sounds when MT4 is on work but are very distorted like something got corrupted.  As far as i know nothing got changed.  Any ideas? Thanks! Andre 
#property version   "1.00"#property strict#property indicator_chart_window#property indicator_buffers 1//+------------------------------------------------------------------+//| Custom indicator initialization function...
A link would be appreciated.  Thank you.
I just create a EA that contain a .DLL created by my self. The EA work fine when I put it in one symbol (anyone), but when I try to run the EA in more that one symbol, it crash. I made a copy of the EA without calling the DLL and everything work fine, so I'm assuming that the problem is when each EA...