Download MetaTrader 5

MQL4 and MetaTrader 4 - page 114

To post a new topic, please log in or register
Hello I have this indicator: int OnCalculate(const int rates_total,                 const int prev_calculated,                 const datetime &time[],                 const double &open[],                 const double &high[],                 const double &low[],                 const double...
Hello,  Can you help me please?  We define the array as UpTrend* UpTrends[];   And the code of function call  UpTrend* trend=new UpTrend(Time[lowest_index_on_range],Time[1]);             if(trend.isSuitable() && !trend.hasSameLow(UpTrends))               {                                  int...
for(int i=0; i<limit; i++)      {       //---- ma_shift set to 0 because SetIndexShift called abowe       ExtBlueBuffer[i]=iMA(NULL,0,media21Period,0,MODE_EMA,0,i);       ExtRedBuffer[i]=iMA(NULL,0,media8Period,0,MODE_EMA,0,i);        Ima21candprec[i]=iMA(NULL,0,media21Period,0,MODE_EMA,0...
  [deleted] (1)
[deleted]
[deleted]
Hi, I'm using classes to reduce clutter. I am trying to make each order (each ticket) be able to store their own exit strategy prices after running exit checks.  i have a Class called CTicket and each instance of CTicket has their own corresponding instance of class CExitStrategy where it stores the...
Hi Who can help me? What Validation Failed? Is my expert problem? Thanks  
Hi All,    I have installed MT4 a couple of times on my Mac Book using PlayOnMac and the tutorial provided on the mt4 website but today I can't figure out what is going on. I download the mt4setup.exe file from mt4.com but when I install it, it installs mt5, every time. I have reinstalled playonmac...
I am using the MT4 enumeration for a selection input: enum ENUM_myChoice { a, b, c, e, f, g }; The problem is if I have to add "d" to the list in alphabetical order, all of my templates using e, f or g are ruined because they are off by 1. Is there an elegant solution to this or only brute force?...
Do you want to transfer data (does not matter what kind) to from 1 application/chart to x applications/charts inside different/same window? Here is a demonstration how this can be realised. We have a free tool called "PermVar" since 2 years now but it does not get much attention among coders because...
How do I draw rectangles on the top of the chart? I also want them to stay there if I zoom or unzoom. 
Hi, I'm relatively new to programing MQL4 and would like to know how to code an expert to understand the open and close prices of the previous bar? Any help would be appreciated. Thanks, Chris.
//-------------------------------------------------------------------- //+GLOBAL Variable declaration //+------------------------------------------------------------------- double ExecutedBarOpenPrice=0; //+------------------------------------------------------------------+ //| EA initialization...
I want to get the output result of a function and show it on the chart:   ObjectCreate(pastaverage, OBJ_LABEL, 0, 0, 0);    string value1=DoubleToStr(checkaverage(), 7);    ObjectSetText(pastaverage, "Average of previous bars:"+value1, 15, "Arial", CornflowerBlue);      ObjectSet("ObjName",...
I need a short code to add expiration date and time to my expert. void OnTick() {//1 if(!expire) {//2 expert body }//2 else message("Expired"); } //1 bool expire() { if expiration date reached return(1) else if exp date did not reached return(0) }  
So I created a text object and display it, e.g ObjectCreate(0,labelID,OBJ_LABEL,0,100,100); ...but if its output changes the old text doesn't disappear.   How to refresh the chart to remove the old text? Thanks.  
Right after spending basically all day researching and double checking bits of code from all over the place, I didn't find a nice, reliable, but simple and easy to implement function in one place that I could drop into my code which would give me the lot size, adjusted for JPY and 3/5 digit brokers...
when compile EA ,the terminal was shut down ,and I get this infomation ,how to solve it ?  thanks . 问题签名:   问题事件名称:    APPCRASH   应用程序名:    terminal.exe   应用程序版本:    4.0.0.1031   应用程序时间戳:    00a97c00   故障模块名称:    terminal.exe   故障模块版本:    4.0.0.1031   故障模块时间戳:    00a97c00   异常代码:    c0000005   异常偏移...
Hi,  I have tried loads of my own EA ideas, buying "commercial" EA's, spent thousands of hours analysing indicators all with the net result of losing about £50k. So my simple question is this - Do any of you out there make any money at all from your EA's?
Hi,  I have a problem can you help me please. I have downloaded historical quotes for this month and I import it to the MT4 platform, when I'm looking back on my platform, I see that the quotes is on the mt4 platform but When I'm doing backtesting, the tester use only one day (01/12/2016) even if...
is this working? extern double MaxSpread = 5.0;Spread = (Ask-Bid)*10000;if(Spread >= MaxSpread) { return(0);}
Hello guys, we have an EA that on paper is perfect, but on the market its not working properly we would like to have some help regarding this. Please feel free to post your idea here. Thanks in advance.
Hello I want to obtain the high price of the previous candles and calculate the average price. double average1() {//average1 start double highfirst[]; CopyHigh(FirstSymbol,timeframe,0,50,highfirst); sum=0; for(int k=0;k<=noofbars;k++) sum=sum+highfirst[k]; double ave=sum/noofbars; return (ave);...
Hello, I suspect I'm getting the wrong results from my code when calculating position sizing. What I want to do is, calculate the number of lots I need to open my order of. They are dependent on the stop loss placement, and the money I would like to lose if that stop loss value is achieved. My main...
Hi all,   For my EA i want to read out a specific value from an indicator. For my case, i want to read out the int "changeofTrend" from the super-trend indicator. So whenever "changeofTrend ==1" occurs or is true, i want to the close the last order! The super-trend indicator i use is in the...
How do I install this indicator on MT4?
Hey Guys, I programmed a EA with an Indicator called SuperTrend. My problem is that if the market triggered the line to sell or buy, I am getting the Error "#02" and the Order isn't placed... Does anyone has a idea and can help me?  (SuperTrend is attached!) if(tpBuy < Bid){       hitTarget = true;...
How can I draw lines using buffers in an EA to produce the following effect? Using one buffer with DRAW_SECTION makes one continuous line, I want it broken up into segments like this -    Thanks in advance! 
Hi all, how can i count optimization passes to write them into a csv? int deinit() {     if (IsOptimization()){          // Counting passes       } } Wich approach use?  Thank you 
https://docs.mql4.com/constants/objectconstants/enum_object/obj_rectangle   I have read the above and searched, but cannot find how to amend the following piece of code so that all rectangles are extended to the hard right edge. ============ ObjectCreate (0,StringConcatenate("kkx",index)...