MQL4 and MetaTrader 4 - page 170

To post a new topic, please log in or register
Hi, this is my first post and my first MQL4 project - writing code for the %B indicator. I've used a combination of copy/paste and reading both the online book, articles & a Metatrader book to write my first code. I hope I've understood buffers and most things correctly. The compiler says there's...
Hi fellow traders, Do you guys know how to fix this time issue? There is 2 hours difference from settings in actual chart. I want the blue box to start from beginning of the day at 00:00. Thanks a lot   
Hi! I have an indicator (and a EA) which reads a relatively large set of data from an external *.txt file in the "\MetaTrader 4\MQL4\Files" directory using FileOpen. Everything is working correctly, but I would like to ask if there is the possibility to include this set of data into the ex4 produced...
Hi everyone,  As I was trying to create an array that will assign a unique name to each arrow on the graph ("Down 1", "Down 2", etc.) I got "data mismatch" error.   string highArrows[]; ... for (j=0; j<=highPicksCounter-1; j++)    {    ArrayResize(highArrows,highPicksCounter);...
  iHghest HELP! (2)
Hello my brothers. I'm trying to make a indicator. iHighest = 20 bars to get the highest price. Now:   Expected:     What is wrong?? :(((  thank you so much! double UpLine[];  void init()   {   SetIndexBuffer(0, UpLine);   SetIndexStyle (0, DRAW_ARROW);   SetIndexArrow (0, 159);...
Hello everybody, I know there are already a lot of topics like this but I don't understand them. How can I get all OpenTrade ID Numbers, to make particial close if the price if above or below a specified border? Greetings and Thank you! 
Hi,   I have an indicator with various parameters. But one line isn't functioning as intended:   MathAbs(iHigh(NULL, PERIOD_M1, iHighest(NULL, PERIOD_M1, MODE_HIGH, 11, 0)) - iClose(NULL, PERIOD_M1, 1+i)) > MathAbs(iClose(NULL, PERIOD_M1, 1+i) - iLow(NULL, PERIOD_M1, iLowest(NULL, PERIOD_M1,...
I'm having internet problems at my current location and have been thinking about getting a VPS to trade. My main concern is security - not from external sources like hackers, etc., but from the stuff at which ever hosting company I get the VPS at. I've been trying to research the subject, but can't...
New article Graphical Interfaces IX: The Progress Bar and Line Chart Controls (Chapter 2) has been published: The second chapter of the part nine is dedicated to the progress bar and line chart controls. As always, there will be detailed examples provided to reveal how these controls can be used in...
Salaam; I need a demo account from a broker to get data of all commodities. I have a real account Now but it does not have them. things I want: Lead ; Zinc ; gold ; wti ; brent ; sugar ; dollar index ; copper .... thanks
  Max of 10bars (2)
Hello!! how to know the maximum value of 10 bars?   Thanks people! =) 
  Ema of Previous Bar (21   1 2 3)
2016.08.02 13:00 Indicator USDCAD,H1: USDCAD H1 Ema20:Ema201= 1.3105:1.31082016.08.02 12:00 Indicator USDCAD,H1: USDCAD H1 Ema20:Ema201= 1.3110:1.31102016.08.02 11:00 Indicator USDCAD,H1: USDCAD H1 Ema20:Ema201= 1.3111:1.3110 Dear All, Above show the  EMA 20 (Ema20 is current bar and EMA201 is...
Hello Im trying to copy the value of a member of an array to another position in the same array. I get the error: '=' not allowed for objects with protected members or inheritance but I dont understand why I get this. Can someone help please? Code: class COrderEntry{    private:        #define...
  Help TS MA (6)
Hello I have a problem with the TS. the closing of the position, the TS should not open another position until the two moving averages are not touching. How can I do ? Thanks for your help
I know there are classes that can be used to draw graphics on the chart, I am developing an indicator that will have lots of graphics and trying to run it becomes very slow, its not an option. So I need to know how I can use if possible the windows api to completely redraw the entire chart, put my...
Hi! I want to explicitly convert 'enum' type into 'int' type. // --- global variables ---enum TRADE_TYPE{DontTradeType,TradeType,BuyOnlyType,SellOnlyType};TRADE_TYPE Trade_type;// then I pass 'Trade_type' into function call - SetBtnText(setSparam, Trade_type);// --- TRADE BUTTON TOGGLE...
#property strict#property indicator_chart_window#property indicator_buffers 5//---Indicator Colours#property indicator_color1 clrGreen//up arrow#property indicator_color2 clrRed//down arrow#property indicator_color3 clrCrimson//SMA10#property indicator_color4 clrNavy//SMA25#property indicator_color5...
When I restart the mt4, I found that the lines I drew, they all lost. Can anyone tell me how to save the lines I drew?
As I know I can use objectcreate to add a button but objecttype no checkbox type.   How to add a checkbox 
Hello, I implemented the class CListView in my code to make a multiple line editable list (for the user to write in). Everything works well except one thing: only 1 line is selectable at a time with the mouse. Any idea how I can make it so that dragging left-click over the list, it selects all lines...
Hello, fellow coders! Recently Ive been using buy/sell scripts in my trading where you can set up the % of account balance you are willing to risk and how many pips will this % represent. Code for this script where you input the variables - #property show_inputs        double...
Hello, MQL community. I hope you can help me with the following issue: I am trying to print a zScore of daily ranges (which is just the standardize function in excel) and horizontal lines in the same chart. When the zScore[i] > 4.36, the code zooms into the 1H time frame of daily bar[i], looks for...
  Hiariables (2)
Hi, I variables with the name that is variable. I try to explain: double highprecEURUSD = 0; double highprecUSDEUR = 0; check ("EURUSD"); void check( string valute){ Print(highprec + valute); } I would like to print the value of the variable depending on the string passed to the function check....
New article Cross-Platform Expert Advisor: Reuse of Components from the MQL5 Standard Library has been published: There exists some components in the MQL5 Standard Library that may prove to be useful in the MQL4 version of cross-platform expert advisors. This article deals with a method of making...
New article Graphical Interfaces IX: The Color Picker Control (Chapter 1) has been published: With this article we begin chapter nine of series of articles dedicated to creating graphical interfaces in MetaTrader trading terminals. It consists of two chapters where new elements of controls and...
dear all How to use OBJ_TREND to draw trend line from the High of day snd the High of previous day   I make this code , but not workable , what is the correct code       double Hi0=iHigh(Symbol(),PERIOD_D1,0);      double Hi1=iHigh(Symbol(),PERIOD_D1,1);   ObjectCreate("mytest",OBJ_TREND,0,Time[0]...
Using MQL4, how can I execute a BUY order (seen below) if one variable x has a value of 1 and another variable y has a value of 3? I need it to work like this: Variable x = 1 Variable y = 3 So if x is MORE THAN y, execute this script: extern int TakeProfit = 10;extern int StopLoss = 10;void...
Hi guys! I’m looking for a function that returns if the last trade was a win or lose trade. In other words, if the price hit the take profit or the stop loss of the last trade. If someone decide help me, so, PLEASE, give-me a function that you have sure that work correctly, because I’m not...
Hello guys.   I need to change the computer clock to the broker time automatically.  I now i  has to import kernel32.dll and use SetSystemTime function, but don't know about the parameters of this function.  Does anyone know how to use it?