MQL4 and MetaTrader 4 - page 750

If you run the following you get back a time that is not on par with hour timeframe. int n=iBarShift(NULL,PERIOD_M1,iTime(NULL,PERIOD_H1,2))-60;Print(iTime(NULL,PERIOD_M1,n));//Returned value equals something like 23:03 Also in chart, If you count 60 bars with crosshair(click and drag) from an hour...
Hi there I am trying to send some information from metatrader to excel using (mt4excel.dll) but I have problem to wright text into cell using the function (ExcelSetTextCell (int X, int Y, string Value)) for example if I wright (NAME) the excel shows only the first letter (N) any help with this??...
Hello, I have a weird problem: Using EURUSD D1 (Day) data from the History Center for a specific day I see as the Closure value: 1.34286 Now when I run an EA to calculate the RSI for the past 100 D1 bars using closure values, those don't match the RSI indicator in the chart. When I printf the
[Deleted]
Hy! I read a lot of article in this topic, but I don't find the solution for my problem. I had a code which is work fine before upgrade MQL4. (My last upgrade was about 1 years ago, so I know a lot of things changed.) But now my MySQL connection doesn't work. I insert the code, and the error
Hi, I'm trying to code an EA that will not react to the huge spread my broker generates during news.  I realize "guarantee" is a strong requirement so maybe "reduce the impact" is a better.  I know there is a slippage parameter in the OrderSend() function but it doesn't seem to work. As always, any...
Hi, I am new to MQL and can someone able to write MQL code based on the following conditions. I would like to draw continuous line based on the following conditions: 1. If current bar close higher than previous bar close, draw the lower price level line (The lower price level is the lower price...
[Deleted]
//+------------------------------------------------------------------+ //| MTF2 MACD BDv09_01_20.mq4 | //| Jeff | //| wolfboy@att.net |
[Deleted]
Hi Guys I am using Meta Trader 4  Server FXCM-USDDemo02Build 670 version 4.00 (4th July 2014)I am in the UAE using Etisalat as my ISP. I have a CISCO router and have port forwarded the port 443. When I use another ISP "Du", this problem does not seem to happen. The connection shows as red/green...
To import a csv or ASCII file into Metatrader 4 ---you have to go to Tools---History center---import.Then you have to select a symbol in the window on the left of history center and ---navigate to the folder on your PC and click import.Supposing the symbol I want to import is not showing in the left
Hi I need an indicator that can calc the lot size based on given percentage. anyone has any scripts to give? it must consider the equity and also leverage for that calculation.
Hi there, I have code that opens and reads a file when run in a script.  When I copy the function and put it in an EA and test it in ST an error returns as below. 5004 ERR_FILE_CANNOT_OPEN Cannot open file The script: input string fileName="eventdates.csv";string token,year,month,day,time;datetime...
Hi, to assign a variable a specific ASCII-Char e.g. 7 (BEL) one can do this:         string b = CharToStr(7); but I cannot use this function if I want to define B as Bell:       #define B 0x07 This will be just 7 :( Is there a way to define B as Bell using #define? Thanks in advance Gooly
Hi guys,   Since a few days I can't use the MetaTrader 4 application (android). I can open this application but it hasn't a connection with internet. If I open it with a wifi connection, everything is all right. I have this problem single on this application.    Is this a bug or is this to do with...
When I compiler following code ---------- code begin ------------ enum ENUM_ORDER_SYMBOL{ EURUSD , S&P500, OILUS }; ---------- code end ------------ there're "comma expected" error #155 it seems we can't use "&" and "-" characters in enumeration. how to solve this issue
Hi, I need to check the time is between midnight and 12:05 (GMT +2) in an IF statement. How could I do this?? Thanks, sam
  Trailing stop?  (5)
How can I check to see if the price has increased since the last tick so EA knows when to change the stoploss
Hi there, Your assistance is appreciated, thanks. I have a csv file that looks like this: 20140103 14:30:0020140106 10:00:0020140106 17:30:00 FileReadDateTime() "Reads from the file of CSV type a string of one of the formats: "YYYY.MM.DD HH:MI:SS", "YYYY.MM.DD" or "HH:MI:SS" - and converts it into a...
OK, I've been on it now for ages, time to get a sanity check. The code below is only the important parts of my EA, which operates fine, but in order to get a more automated way of calculating the best stoploss without trawling back through visual charts, I write open close and peak pull back for
[Deleted]
Hi ! I am glad to adress all of you. I have an issue with my MT4 platform. I've programmed an EA. and tested it. But it never opened any position. I though first  it was , maybe, my conditions were too tight, that's why I've tried to run an other EA. A very simple one I knew ( because I saw it in...
Hello   Sorry for my english  If i put a ATR on a ASI chart i can see crossings but when i read the real values they dont cross ! Is it possible  to calculate a scale ( the same vertical position on a chart is not necessary the same value !)   Thanks for your help an comments 
[Deleted]
Does MT4 operate on Windows 8?  If so, does anyone have a link where I can download?  I have MT4 Build 670 on my Surface 3, Windows 8, and it seems fine except for that some of the indicators overlap and are unreadable. This same version of MT4 works well on my Windows 7 machine. Has anyone tried...
[Deleted]
Exercise MQL4 Subject TDD  Hello,  Exercise MQL4  Subject TDD  I know you, to do an MQL4 exercise is missing to you.  ;-) Perhaps you're already on vacation and your child part is nostalgic for a holiday homework.  Statement:  Write a MQL4 EA passing all tests when using with specific conditions...
Hi When I am setting up a pending order there is a minimum distance from the current price level of 30 pips, which makes most trades useless. Is this normal ? Thanks N
I thought when sending the order cbt is set to 1 so no second order wil be sent. But on my demo account another order was set within 40 ms, how can this happen, what is wrong in that code? How can I impeed that in the code? Thanxx for help! 2014.07.23 18:40:51.796    '9013517': order was opened :...
[Deleted]
I wrote an EA that scans multiple currencies and multiple time frames and checks for their Ima values. The EA works fine, but I want to add non standard time frames to the list of time frames I scan (2 and 8 hours), is it possible? I saw that non standard time frames can be used only on offline
I want to add an expiration on my EA based on a alert of the indicator, how do i do that?  How do i change a TRUE/FALSE or number value into a word value?  I want to change extern bool Expiration=false;, or extern bool Expiration=60; into ……….. Expiration = 'an alert from my indicator' ; Ed 
Hello, I would like to ask you whether exists some substitutions for OnTrade() event handler which perfectly works in MQL5 but not in MQL4?    Thank you very much for possible responses and any advices are welcome.   Regards   Lukas 
Hey everybody, I try to create a little output into the expert log on MT4. What I do: int start() { int i; for (i=0; i<=2; i++) { double lB_EURJPY_D = iBands("EURJPY",PERIOD_D1,20,2,i,PRICE_CLOSE,MODE_LOWER,0); double uB_EURJPY_D = iBands("EURJPY",PERIOD_D1,20,2,i,PRICE_CLOSE,MODE_UPPER,0);  //Print...
Hi, I’m trying to calculate swaps in deposit currency, but the results do not seems to be consistent with whant MT4 shows in the Order windows (Swap column). What does the Swap column show? The Swap is in Points or in Deposit Currency. (While you can choose what to display in the Profit Column, you...
Try to display ATR levels for today's range, 10, 14, and 21 day ranges. The bottom right corner. I made my best attempt at it and have been tinkering with it for quite a while without much luck. Got it narrowed down to only 5 errors. Anyone want to point out the corrections?