MQL4 and MetaTrader 4 - page 202

To post a new topic, please log in or register
My alert() function accumulates messages each time it triggers. I want it to output the messages only once and not to accumulate it in several lines. Somebody may help please. See picture below for perusal. The required message is the one above while the unwanted messages have been highlighted in...
I'm trying to group some common functions into a library of my own and for some silly reason can't get things to work.    In my rlib.h file (located under "...\MQL4\Include" I do the following):   #property copyright "xxx" #property link      "xxx" #import "rlib.ex4" int     subGetMagicNumber(int...
Hey coders, sometimes I need a tick, may it be on a weekend or during quiet market times. I thought about forcing a tick by calling OnCalculate() from a chart event. This was my first idea: void OnChartEvent(const int id,                  const long &lparam,                  const double &dparam...
what is the best way to make a flag using the ObjectCreate function or bufferI can not seem to distinguish between the two I find indicators with 0 buffer and others with buffers please can any one explain to me tje difference thank you
Hello, I have a problem to assign values to different local variable, I have 5 position open at different prices but my script gives the same value to 5 different variables Where is the problem??? thank you for any help
Hi all, This is my first attempt at programming an EA. I am running into a error everytime i tried to do backtesting for my EA. Error is OrderClose error 4108, and unknown ticket for OrderClose function. I can't seem to find any bug in my code + the error seems to happen at random, i.e. the code...
Hello everyone,   I am kind of a newbie. I would like to know if it is possible to give backtest start and end dates dynamically. I want to run a code more than one different time ranges. for ex: first I will execute the code for January and then for February etc... I do not want to use a larger...
  Array or not to array (29   1 2 3)
Hi Guys.... thanx for any input Could someone please point me in the right direction here.... I am trying to create a function (well 2 - Buy and Sell positions) that will provide me with the following information: For all open Buy positions that are in a Loss: 1. The Order ID of the "furthest" Buy...
Hello comrades, how can I instruct my broker to place pending orders or direct orders at a particular price on a future date or even close orders, without having to use Expert Advisor? One cannot be on line all the time.
Hello all Is there a compatability problem with MT4 on the Microsoft Surface pro 4 tablet?  I managed to load the MT4 platform and it was working, but when I tried to load it again a few days later I got a frozen screen and no live data. Just wondering if anyone else has encountered the same...
Hello all, If you are not aware about it, you have to know that Metaquotes is pushing hard for traders and brokers to adopt MT5. They are currently developing MT5/mql5 to fill in all the missing features that prevent the switch to MT5 from MT4. MT5 allow now to hedge/lock in a similar way to MT4...
Hello, are the ticks while running the Strategy Tester 1) automatically generated or 2) are the same as delivered by the data provider (e.g. FXCM)? Thank you!
#property copyright "Copyright 2016, MetaQuotes Software Corp." #property link      "https://www.mql5.com" #property version   "1.00" #property strict extern int period1 = 50; extern int period2 =150; void OnTick() { bool bill; bill = rsi(); if (bill = 1) { ordersendbuy(); } else if (bill = 0) {...
Hi, I have a few orders open for different currencies, how can I find is there an open order for certain Magic Number?
Hi, has anyone heard of brokers restricting the 'OrderCloseBy' function? I don't want to waste time opening an account with a broker (such as IG Index) that does not allow this function. I would effectively be crossing two lots of spreads. I was wondering if anyone knew if this is a broker...
New article Applying fuzzy logic in trading by means of MQL4 has been published: The article deals with examples of applying fuzzy set theory in trading by means of MQL4. The use of FuzzyNet library for MQL4 in the development of an indicator and an Expert Advisor is described as well. The...
New article Deep neural network with Stacked RBM. Self-training, self-control has been published: This article is a continuation of previous articles on deep neural network and predictor selection. Here we will cover features of a neural network initiated by Stacked RBM, and its implementation in...
  Trailingstop EA won't work (40   1 2 3 4)
Hi Everyone.  I cannot get my EA to work properly.  I am running it on 10 different pairs/charts simultaneously.  There seem to be two problems: 1.  It does not trigger the Trailingstop most of the time.  Sometimes it works, though.  I think the problem lies with my OrderSelect, but cannot resolve...
I was practicing to make a simple E.A.but the following errors occurs . "        '}' - semicolon expected                             " "        'else' - illegal 'else' without matching 'if'       "  Can anyone please point out my mistake in the following program  and make the correction. #property...
Hello As there is clearly only one correct answer to the question, 'How many pips of profit does my current trade exhibit?', I'm interested to see the most efficient way of coding this. I could work this out from reading, but I'm concerned about missing a vital point, and wondered if someone would...
is it possible to give an array as a return value, like this? double[] function23(...){   double erg[3]; ... return (erg);}
  Simple experts (261   1 2 3 4 5 ... 26 27)
This thread will be used to post simple expert advisors ________________ The experts that are going to be posted here are not going to be complete trading systems - after all, building a trading system is much, much harder than the majority of traders want to admit it - but to post code for simply...
Hello For a while I've been using the following lot size calculation in EAs, and more recently in a script I can drag onto a chart for it to do the lot size calc for manual trades automatically.  My trading partner said, 'wow and it handles situations where the base currency is GBP and the pair for...
when i send my expert advisior ex4 or mql4 to another folder or another device code dont work in tester , what should i do ? any idea ?
Hi, I would like to create two Lines showing the "opening bar" for daily time frame in the lower time frame The problem with the following code I'm not able to change "color, width, ...) also I don't know if it update auto or not. More explanation in the attached image. Any help will be highly...
About Alpari historical data. so i called them a couple days ago for the time used in historical data and they told me all the time in historical data is in EET+3 and EET+2. is this true? I look up on a lot of website and said time they adopt has changed since 2012.... Im stuck since I'm trying to...
Not sure if this is a known problem but I'm unable to set the OBJ_ARROW_BUY and OBJ_ARROW_SELL properties. string obj_name = PREFIX + " Arrow:" + TimeToStr(Time[i])ObjectCreate(0, obj_name, OBJ_ARROW_SELL, 0, Time[i], Low[i] - (WindowPriceMax() - WindowPriceMin()) / 15);ObjectSetInteger(0, obj_name,...
I have been trying to calculate a variable which takes iLow data from EURUSD but running into obstacles. Anybody have an idea how I could properly do this? I'm not an expert programmer, so constructive criticism please, no disparaging comments.         variable1 = -100 *(highClose*highClose -...
Hi, I'm looking to measure difference in two prices in points, in other words as example if I have price of 1.1112 and 1.1102, hot to measure 10 points difference? I can subtract one from another but I get 0.0001 instead of 10. Thanks!
I'm trying to figure out how to draw a horizontal line from the start of a day to the end at the open price, of the day.  Not sure how to represent start of day in the following code.  Any thoughts would be greatly appreciated.  I was thinking of converting time to seconds, but then, I would have to...