Download MetaTrader 5

MQL4 and MetaTrader 4 - page 182

To post a new topic, please log in or register
Hi, How does one write a script that can apply an indicator onto a chart. I can set the initial parameters of the indicator from the script. Is this even possible ? Thanks.
  MQL4 first step (32   1 2 3 4)
Salute folks, A lot of reading has been going on and the tone is clear on doing the stuff yourself. I have never written a line of code in my life and desperately want to try and code my own basic EA. I have tried to read through the manual and start losing the plot halfway down a page each time...
Hi guys, I'm trying to debug my EA on history data and the option on the menu is always disabled. I see it works fine with real data. I already did the necessary setting under Tools -> Options -> Debug tab and the menu option is still grayed out. I found some old topics about this subject but they...
  close MT4 (2)
I could be overlooking this, but is there a setting in MT4 that gives the user a "are you sure?" question before closing MT4? Using RDP, I've closed MT4 a couple of times when I meant to close RDP. Yes, lot's of cursing... thanks.
Hi,  I am a little bit confused with the use of const inside a function, as an example below. The document says the following "The const specifier declares a variable as a constant, and does not allow to change this variable during runtime. A single initialization of a variable is allowed when...
Hi all i am new in with mql4 and i am learning to programming in this language. I want draw at time [i] the close value of Bar M5 at all hours 20 miinutes. Ie each H1 bar close i want draw  xx:20 (range xx:20-xx:24) M5 close bar. For example: Close bar H1 at 11:59 then mql4 draw close bar M5 11:20....
I refer to the sample given in the documentation. How are we meant to use OnCalculate? With the old "start" event, we have a for loop to calculate the indicator per bar, how do we do that here with OnCalculate?why are these arguments have an ampersand, e.g. &open[]? What is the difference with the...
Hi, I'm about to write my first EA and I was hoping for guidance and perhaps someone could point me towards a similar simple example. I hope to write a simple EA that just calculates and prints values for now and then build on it. As a training project I'm going to use Ichimoku...  Phase 1. Simple...
Hello, I  have ordered an EA. I want some minor changes but it not one file like I use to download from https://www.mql5.com/en/code/mt4. When I opened main .mql file it does not contain anything except information. That's the screenshot: There are couple of .mqh file inside and outside of those...
I'm using MT4 but I can't figure out how to clear the current chart and profile so I can start new chart and create a new profile. When I delete clear the current chart and profile it saves the changes as part of the profile so I lose the original definition fo the profile. It is very frustrating...
I am observing that there is good gap on monday opening in EU from last two weeks. Need some tips to trade this gap.
Hi , i use one NN indicator partial coded by my self. I need to put the result of indicator in one buffer to stay on the chart, is like a target price . My problem is how to do that if indicator wich is reseting it self and by that he use " DeleteAllObjects'(for delete all neuronal network created)...
Can anyone understand why these indicators don't work in MT4? I open the .mq4 file in the editor and I can see the math formula used to calculate it is correct, but the value displayed in MT4 is wrong!
Hi all! The public indicator i-regr is so useful but the maximum degree is 8 and no have extrapolation. Not yet. By example, the statistical software Stata have max capacity of degrees of 11.000. For powerful machines. My intention is to modify i-regr to support many degrees as possible and to have...
Is there any way to automate the process of strategy testing. l want to run multiple tests for various assets with different parameters of each and save the reports. Is there any native or third party api to write code and execute the tests automatically or can l write a script to do the whole...
//+------------------------------------------------------------------+//|                                           MySmoothnessMetric.mq4 |//|                                                  Daniel Donnelly |//|                                             enjoysmath@gmail.com...
A tick seems to occur every second or several times a second in MetaTrader 4.  And every tick OnCalculate() is called.  However, OnCalculate's parameters such as high[i] are such that each index in high represents one minute of data minimally (by setting time frame to 1M). So what is the deal?  How...
Hello, I'm in the process of porting some old code (start(), init(), etc) to the updated MQL4.  I've gotten rid of all the compiler warnings and replaced start() with OnCalculate() and so on.  Now without this one line, the chart window stays open (desired operation), but with the line, it crashes...
Hi, I want to import some csv files with names which differ with metatrader symbols. For example 100 csv files with diffrent names with metatrader symbols. I want to see charts of them after importing csv files(names differ with common metatrader symbols). Is it possible doing this?
Hi,  I would like to know how I would program a indicator that has another indicator as an input?   Example: I would like to put a Moving Average over a Average True Range.. So in human language I woud like something like EMA(ATR(15), 8)[0] to read the current 8EMA of the 15-period ATR.    If...
  Scripts and chart change (20   1 2)
If I run the script below and change charts during it I get the message shown - does anybody know how to get the script to "ignore" a chart change command and just continue? thanks void OnStart()  {    while(IsStopped() == False)   {    .    . some code        Sleep(200);   }  }
Using the crosshair functionality, one can click on a point in the chart, keep the button pressed and move the mouse. This will display a line a distance in points between the initial point and where the cursor is. I would like to read that distance in points (or to calculate it somehow) from my EA....
It is confusing. Since expert advisors and indicators execute just based on basic historical data such as D1 (close, high, low, open) , and on the other hand historical data in demo and real metatader is equal, so why expert advisor and indicators result differs in demo and real MT4?
Hi, I'm trying to run multiple EAs at once using live data.  My bots work fine, and they make trades without clashing. My problem is that I want to be able to pick out which bot made which trade, from the trade report.  Is it possible to append some sort of identifier to the trade report? I've...
Here's the importing hello world indicator: //+------------------------------------------------------------------+//|                                          MyLangTestingGround.mq4 |//|                                                  Daniel Donnelly...
Hi, I am a programmer, my boss has required me to develop a program for MetaTrader that can read his current indicators (7 moving average, 1 MACD and 1 Konkorde). His Idea is that a program recognizes certain signs from those indicators, so then a buy or sell.   What language, script, MetaEditor or...
How do I get at the datetime string?  In the sense that the following code will then work:           datetime now = TimeCurrent();                almostUniqueIndex = StringSubstr(now, StringLen(now) - 3) + WindowsTotal();   I'm in the processing of migrating legacy mql4 to updated mql4. 
Hitraders, I’m quite new on MT4 forums and couldn’t quickly find answers on my 2questions below.   Forstudy of price patterns I indent to print MT4 chart-pictures, each containingbasic info, linked to time-price bar-positions [ ObjectCreate (objname, OBJ_TEXT,0,time,price) ]. For instance...
Hi,  With some indicators that I have code for, when hitting "Debug / Play" in the MetaEditor, the terminal will bring up the input parameter dialog, I hit Ok and then nothing shows up in the chart (where as drag-n-dropping in terminal shows something), and the window focus moves back to MetaEditor...
i am currently coding a trading log which executes everytime a trade is closed. one of the values for my log is the stoploss. however, i want to use the original stoploss when my trade opened, but since i modify the stoploss during the trade, calling OrderStopLoss(), does not give me correct value....
1...175176177178179180181182183184185186187188189...1245