MQL4 and MetaTrader 4 - page 166

To post a new topic, please log in or register
I'm trying to code an indicator that displays a histogram of each hour in the past based of a candlestick's high and close. For example it calculates whether each specific hour in the day has been bearish or bullish based of the past data. For example..   Each bar in the histogram represents each...
Hello I am trying to introduce a "circuit breaker" in my code to suspend EA operation if it detects unsual activity over a defined period of time, e.g. the "flash crash" of GBPUSD on Oct 6, 2016, and June 23 when the Cable fell off a cliff. Obviously with a major currency pair there will be times of...
If I have two points with two different times can I know the time difference in minutes?  
All,  I have write a EA for test, it imports some functions from another DLL, but I could not do the back test, it always said 'the DLL is not allowed', e.g. "2016.10.15 10:28:09.389 2016.09.01 00:00  Cannot call 'ConsoleApplication2.dll::InitPipe', DLL is not allowed.' But, how can I allow the DLL...
Where the best place to put the global variables? Inside init(){...} or outside the function?? My variables will used in many functions repeatedly.  I want to know the best way and efficiently to create indicator. 
I found BUG in Nested if - else if - else if - else. I can't declare same variable name in other blocks.  According to MQL4 documentation: A variable declared inside a block (part of code enclosed in curly brackets) belongs to the local scope. Such a variable is not visible (and therefore not...
void OnStart()  {   double Lots=((1860.03*1.0/100)/(114.542-114.511))/(0.87/0.001);   double NormLotsRound=MathRound(Lots/0.01)*0.01;   double NormLotsDouble=NormalizeDouble(Lots,2);   Print("Lots is, ",Lots);   Print("MathRound(Lots/0.01) is, ",MathRound(Lots/0.01));   Print("Lots with MathRound,...
Hello, I have an EA. I want to insert security code in it. I want to do that the EA works till specific dat and time. Forexample; I want that the EA works till Oct 15, 15:30 pm. Secondly, I want to hide my EA's code. Can you help me, please? Finally, I want tthat the EA works for specific parity....
Is it safe to buy EA from folks you do not really know ?   Can the EA that you buy from some one else online be used to hack into your PC ?   Regards 
The most interesting figures at the Strategy Tester Report are imho Total net result and Relative drawdown. Both figures will be greatly dependant on the choosen Order size. Another valid statement is that the rate between Order size and Account balance together with the Relative drawdown will...
How to remove/clear the candlesticks then put only the indicator in main window? I want to only see the indicator in main chart.
Hello, I write an Expert Advisors program that stores the Indicator values iEnvelopes, iBands and iMA in an Array. Unfortunately, the program doesn't work. No prices are stored in the Array. What must I do? extern int SMA_Period = 4;extern int SMA_Shift = 0;extern int SMA_Method = 0;double...
How to get the current bar color? Is there any function() for this task?  I have an idea to know the current bar color. Comparing if the open price is greater than closing price/current price then it means that current bar is red. Do you think my idea is correct?
As title says, i'm having some problem placing BUYSTOP/SELLSTOP order sometimes, i get Error 130 (ERR_INVALID_STOPS), probably related to MarketInfo("EURUSD",MODE_STOPLEVEL).   My broker return 0 as value from MarketInfo("EURUSD",MODE_STOPLEVEL), i tried to correct the OrderSend price adjusting it...
Hi comrades, how can I continue writing on the next line (similar to pressing the 'enter key' on a keyboard) on the label of a button I have created? Thank you for you in advance?
Hi all Been searching around the forum looking for references in regard to when to use "for - count down" vs "for - count up" statements. I use the following code to check open orders in my bot    int orders_total = OrdersTotal();      for(int pos = orders_total-1; pos>=0; pos--)...
Hi Guys So I have a strategy that I have been using in Mexcel, but I want to be able to backtest it on Metatrader. Only problem is that I have no prior experience in MQL4. The idea of my strategy is to use the 15min, 30min, and 1 hr timeframes (i will write the strategy and laymans terms but I have...
Hello everyone, I should add in the Alert pop-up, the value of a variable double , but as I wrote the code is not good. #include <stdlib.mqh>#include <stderror.mqh>//--- indicator settings#property indicator_chart_window#property indicator_buffers 2#property indicator_type1 DRAW_ARROW#property...
Hi, Sorry for my poor skills with programming. I have a volume indicator and based on this indicator I would like two arrows to show up. Code for my arrows indicators is shown below which I have taken from this link. https://www.mql5.com/en/code/7332 #property  indicator_chart_window#property...
new to meta trader so bear with me.  I am writing an EA - what I want to do is detect a bar change in the Fisher_Yur4ik indicator. Does anyone know how to do this? If so could you supply me with a code sample?   Thanks in advance!    
Hi, I have lost the last week (02/10/2016 - 07/10/2016) download of the calendar news from ForexFactory.com. If someone can upload it here it will be great. Thanks in advance. 
Hi,   In my order window the buy line is red and the sell line is blue. How to change the colours?  
my EA attached on every chart works fine when only one chart on the upperest window ,  i want to see the overall performence of all the chart about 24 charts ,and tile herionly ,ea does not work .
Hi My investor's PC appears to be creating trades OK, SL/TP drawn, but not the actually order line itself.  See the attached pic. I've worked with mt4 and mql4 for about 6 years now and not ever seen this and wouldn't know where to look. Google not returning anything useful either.  Has anyone else...
Please give me sample code of Table indicator with value inside. I read the documentation many times but I don't get it because the sample code in there are not simple enough for average programmers. The documentation lack explanation/good short sample code. Look at this example code in your...
Hi Coders, My MetaTrader is running genetic optimization since a week. It needs some more days before finish. But now, I have to restart my Windows. So, is it possible to stop the optimization and then can I continue it? Thank you in advance. Relative
Params indicator line string or number  output for my EA ?    
Running an EA on a Demo Account and running it on a Live Account   Besides the first being that Fake money is used and the second being real money is used ...     Are they the same, Result Wise ?   Or will there be differences between the results of a real and demo account run ?        
Newbie with some questions to ask    1) In MetaTrader 4, if an EA is used, Is there some way to set the initial "Investment Amount" so that MetaTrader 4 will use only this amount to trade for the full Trading Session ?   2) In MetaTrader 4, if an EA is used, Is there some way to set a "Flag" such...
Dear Sir, The code work me only current time-frame 1 order per candle please modify the code. Thanks..  Code Here <decompiled code removed by moderator>