MQL4 and MetaTrader 4 - page 58

To post a new topic, please log in or register
Hello I would like to use this indicator (Absolute Strenght Histogram.mq4) in an EA. I would like to catch the AlertLine Signal  (vertical lines on main chart) but i can't fint the output (only 2 buffers, the lines in the separate window). How can I do ? Thank you for help
I have an index, I want to use it to make EA, but I haven't filtered the index. Can you help me? I want to trade pounds for 15 minutes.
Hi, how do i calculate the median of these values double g1 = 2;double g2 = 2;double g3 = 4;double g4 = 5;double g5 = 6;double g6 = 6; How to compare them and find the median (witch is g3 and g4.  g3+g4/2  the result should be 4,5) via mql4 code?
  Am I going crazy! (15   1 2)
Hi, I really hate to post this, but what am I doing wrong.??? The very simple code below though obviously false, returns true. If I swap || for && it behaves properly. Please help! void OnTick()  {//---   if(Piv1() == true)      {      Alert("Piv1==true");      }...
So I'm making my first effort into using arrays.  I'm simply trying to store close price at certain times to retrieve later in my code. Is this code going to achieve the desired result or have I ballzed up completely. int OnInit()  {   double EU[6] = {iClose("EURUSD",PERIOD_H1,2), iClose("EURUSD"...
Hello,  I have tick data suite, and know how to run a back test by date, with different set file, different balance, change the spread, watch in real time, skip foward,inspect the results. What i would like to be able to do is for example take 3 charts, same EA, make EA slightly different in max lot...
Hello Supply and Demand Traders, I have a custom expert advisor which trades off supply and demand zones.  The zones it trades off are from this source - https://www.mql5.com/en/code/14545 (indicator attached below).  Here are the rules of the EA: - When price reaches the proximal level of an...
Hello everyone, I am trying to simplify closing order. //+------------------------------------------------------------------+//|                                                                  |//+------------------------------------------------------------------+void ClosePosition()  {   index=...
I wanted to code an EA that would enter a trade once the moving averages cross and close when they cross again while entering the opposite trade. However, it runs fine only until it opens the second trade which will not close. Do you have an idea what is wrong with my code? double CurrentFast =...
I want to get exact BID,ASK value with normalization. But i can not able to do that following most popular way. Print("Bid : " +Bid + "  Ask : "+Ask); Same result on after "NormalizeDouble" string Sbid1 = NormalizeDouble(Bid,Digits);string Sask1 = NormalizeDouble(Ask,Digits);//double Dbid1 =...
Hi, I am trying to make an EA with many different stoplosses and takeprofits. So I wanted to make functions where I can pass the ticket number and it would automatically do the sl and tp. This will save much time and coding. The code below works properly in that it will modify the order, however...
Hi, Can somebody please tell me if my coding solution is correct in solving a 4 H MTF call for an EA that runs on a 1 H chart, or at least clarify further the following: I run a separate EA to call the 4 H CCI to my 1 H based EA as shown below: double CCI_H4=0;   if (iBars(NULL,PERIOD_H4)>14) CCI_H4...
Hello,  Thanks for taking the time to look at my question.  I guess this is a really simple question for some one that knows it. Say you are running mt4, you install an EA, and like most people here we know we can back test it, you load in the tick data suite, you run the back test giving the date...
I have just created an EA that can read the first line of a text file, to obtain a value. Now, I want to use 2 values: the first one in the first line and the second one in the second line. My question is how I should modify the source code to read only the second line of the text file? The actual...
When I use the custom indicator, it shows the graph as follows  ‌ When I use the Expert Advisor with the custom indicator, it shows the following  ‌ It also repeated opened a lot of custom indicator when I am doing backtesting. How should I change the EA such that It only opened a custom indicator;...
I have been working on a custom indicator (currency strength) as my first programming project. I am doing quite well. I am trying to mimic this http://completecurrencytrader.com/currency-strength-indicator.html I have gotten to the point now that my gathered data is matching the graphs endpoint...
Hi I need help in creating an EA based on a custom indicator (attached). It's a fairly simple indicator that signals buy and sell opportunities using arrows. I would like the EA to open a trade at exactly the same time a buy or sell signal comes up. If possible I would like to add a T/P and S/L user...
Hello, I am trying to figure out how to get the current price (DAX/GER30 with 2 decimals i.e 12263.71) and convert it to the next closest round number up/or down that ends in 00,25,50 or 75 -> 12275.00 I am trying with: bidAsInt = MathFloor((Bid/Point)/100); But this only returns 12263. Scratching...
  TTM scalper (123   1 2 3 4 5 ... 12 13)
Well, here is an indicator that works almost like TTM scalper. The explanation for the "almost" : I did not "iron out" the occasional differences that happen between "my" version and TTM version. There are multiple reasons for that. Some of them : the logic of this one is quite clear and I do not...
#property copyright "Copyright 2017, MetaQuotes Software Corp."#property link      "https://www.mql5.com"#property version   "1.00"#property strict#property indicator_chart_window//+------------------------------------------------------------------+//| Custom indicator initialization...
BeLikeTrader
Hello my question is simple, Is it possible to delete a template from code?
Guys i need help with coding... The goal is to... "take screen shot" (done) and "send it to ftp server" (done) then "copy file link to windows clipboard" (problem) This is the code i use, for the script: //create a filename based on "year-month-day_hour minute symbol"  string filename =...
Hello developers of MT5! I use the newest (actual) version of Windows 10, 64 bit. After installation with error, is no possible open MT4/MT5 (of course). I have installed more versions of C++ in PC. It is source of problems? Can you me please help? Can you repair errors in next resale please? (In...
Hi, I am a newbie in mql4 programming. I was trying to code a simple EA to identify the magic numbers of open orders.  Why this code is not working? On compiling, it didn't give any errors but I can not see the comment on chart....
Hello everybody. I am trying to build an EA using Hedging Strategy. I just thinking that it will works eventhough it will give a small profit but still it is a profit. I want to use moving averages like 5 and 21. If the 5MA crosses above 21MA, it will execute a Buy Position. OR if the 5MA crosses...
happy day for all  my expert advisor   idea : putting pending orders in desired place with mouse and keyboard buylimit = CNTRL + left mouse clic in desired place  selllimit = ALT + left mouse clic  it works great smooth and all ... but i discovered  that it wont work on YEN pairs like gbpjpy usdjpy....
Hi, I have what I thought was defensive code on getting a global variable. Can anyone explain why I got an error 4058 ?   if (GlobalVariableCheck(GVQualify + "BadTrendLock") == True)       {        ResetLastError();        BadTrendLock = GlobalVariableGet(GVQualify + "BadTrendLock");        file_err...
How to get max and min value of MACD signal & base line for n period values?? Thanks in advance
Hi, I'm using Metatrader 4 build 950. I am trying to implement an abstract base class use pure virtual methods. After reading the documentation (https://docs.mql4.com/basis/oop/abstract_type), I thought easy - very similar to C++. But is just won't compile - not even the examples in the...
Trying to develop a simple Expert Advisor with RSI functionality but it does not seem to work, in addition to this, I wonder how I limit the number of trades to one at a time. Feel free to improve and correct the EA below. // import the trade library#include<Trade\Trade.mqh>// create an instance of...