MQL4 and MetaTrader 4 - page 385

  I always get 1?  (4)
int return_price(int ttype)  { //function that returns price   int price=0;   for(int cnt=0;cnt<OrdersTotal();cnt++)     {      bool result=OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);      if(OrderType()==ttype && OrderMagicNumber()!=666 && OrderMagicNumber()!=667) price=OrderOpenPrice();     }...
#property strict #property indicator_chart_window #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red //---- input parameters extern int ADX_period = 14 ; extern bool UseADX_level = true ; extern double ADX_level =
Hi, I've been doing some research and there's a "Volume weighted Awesome Oscillator", which uses volume weighted moving average instead of SMA. Does anyone have the version for MT4 ? Help is appreciated. Regards Jo.
Hi, I want toask you how I can use a custom period that is not present in ENUM_TIMEFRAMES, for example PERIOD_Y1 (= 1 Year),in calls to indicators like MACD:   iMACD(NULL, PERIOD_Y1, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 1);
OK, first post so please bear with me !!! Have been using MT4 for some time now and very happy with the functionality, how you can add third party custom indicators/EA to the charts etc.  I have a specific task I am trying to complete, which I initially thought would be fairly straight forward, but,...
[Deleted]
Hello, We want to display web page on the chart windows, by using expert or indicator. This has done on interbankfx mt4 by mt4i. There are different functionality like one click trading etc. But we only want to be able to open a webpage on chart. Can anyone help me about this? Thanks
long searchHandle=FileFindFirst(_subFolder+"\\*",fileFirst); Hi, The above code is occasionally returning a large negative number like -1905372416. This is fooling my code that tests as follows:- if(searchHandle!=INVALID_HANDLE) As INVALID_HANDLE equates to -1 only. I cannot see why I would get such...
Hi, I want toask you, if it is possible, inside an EA to load an indicator from anothertimeframe, different of the current timeframe. Let’s say Iload my EA in EURUSD PERIOD_M15. And I want to see the MACD indicator (12, 26,9); but not about PERIOD_M15, BUT in reference to PERIOD_D1. thanks!
Which one is best when calculating the position sizing relative to the risk of over exposure? Been thinking; I have run back-tests on ST and imported the data per pair into excel and then sorted them chronologically. When these back-tests were done, only one trade can be open at any one time....
Hello, Since I chose programming a market robot in school as a subject (a decision I highly regret) I assumed we would get taught all the basics- mistakenly and since our teacher won´t teach us anything about how to program an ea but still wants to see results from us, I have to train it myself,...
On MT4 I am having a weird issue. On loading an self made indicator on two charts, everything works ok. The moment this indicator is put on a third chart, i am getting No Connection error restarting MT4.  What could be the reasons for this?
  Moving HLine  (20   1 2)
Hi, I wrote this code to mark S/R levels on the chart, but object is not moved at least in backtester:    if(Support>0){ // SUPPORT IS OPEN/CLOSE PRICE OF THE LAST CANDLE      ObjectCreate(0,SupportLine,OBJ_HLINE,0,0,Support);      ObjectSet(SupportLine,OBJPROP_COLOR,clrBlue);      if(ObjectMove(0...
Hi, couldsomebody give me advice on proper Object positioning? I create acolumn of labels and buttons. In some MT4 terminals the appearance is right,but in others, the buttons get painted on top of the labels.
  Really slow VPS  (2)
Hi guys, So since I don't know whom to ask on MQL5 (is there some sort of help desk or something?) I am posting it here and hoping that I will get som help from you guys... This Monday I started a trading account on ICmarkets Live11 server and signed up for VPS hosting through the MT4 platform and...
Hi, there. How can i add custom or mql5 market indicators on mt4 android version? Thanks.
I believe there should be a thread on the forum already having a discussion regarding the subject. But Looking into this in depth and been on my mind for a while now. Is there any solid evidence regarding the difference regarding backtesting and optimization with MT4 on a 32Bit PC and a 64Bit PC?...
Hi experts, I have learnt about mql4 and stuck with "for" loop.plz see the script. void OnStart()  {int e =2;for(int i=1;i<3;i++)  {   for(int j=i;j<j+e;j++)     {      Print(j);     }  }     } It's not complex at all.But The result maked me so confuse.  I think the shown value should be 1,2,2,3....
  draw circle  (2)
Hello , I know how to create an ellipse : ObjectCreate(objname,OBJ_ELLIPSE,window,time1,price1,time2,price2);ObjectSet(objname,OBJPROP_SCALE,scale); But i want  a perfect circle, the plot shape does not change as you zoom in/out, either horizontally or vertically. How to do? Tnx
Have this loop to get some values for code operation:    for(int i=0;i<OrdersTotal();i++){      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)&&         OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber){         if(OrderType()==OP_BUY){            BuyLots+=NormalizeDouble(OrderLots()...
how to remove take profit from buy order i call buy1 when a sell1 order open i need it to attached to the name sell1 because there will be a sell2 in ea code for ex4 mt4 
Hi buddy, I got curious to know why MT4 M1 plot only has past two months data. How I can get access to the M1 data before 2 months?
Hi, I want toask you if it is possible to react to a button clicked from a chart that is openedfrom the main chart which the EA is executed on. I load theEA in the main chart. In this main chart, under some circumstances anotherchart is opened. Inside thisnew chart, the EA creates a button. And the...
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...
  Bid/Ask Volume  (4)
Hello, I'm using MT4 and need to access this bid/ask volume information. Could some tell me how to access it please? Thanks,
Hi all, I have been looking for an indicator or an EA that can push notification or send email when a divergence signal appears at support or resistance zone. If anyone can create a code or mql4 file, please help me. It would be very appreciated. Thank you so much for your help in advance. Best...
Hello Everyone, From the best of my knowledge, both  of these are used within mql4. Question: Why would you choose one over the other and why?
[Deleted]
Two charts are open in metatrader - one EU H1 and another EU M5. I have a script (coded by me) which is running on EU H1 chart . Objective : This script should run only when the expert advisor 'XYZ" is loaded in M5 chart. The script should stop execution if the loaded EA in M5 is "ABC". The expert
Hi, everybody. Can anybody help me understand how to make things right in my script? I'm trying to use several indicators at once, and naturally I got the problem of "your indicator is too slow..." How can I solve this problem? I NEED TO STUDY 5 PREVIOUS CANDLES. That is why I call [i+n] in each...
Hello, I am new to the MQL language. I am attempting to access and apply past values to my indicator based on certain conditions. My test code looks like: int limit = rates_total-prev_calculated;if(rates_total<=DATA_LIMIT)      return(0);//--- last counted bar will be recounted...
In a perfect world MT4 would let me draw buffers from one indicator into both a separate window and the chart window.  I have an indicator in a separate window that does some calcs and draws a modified MACD.  But I also need to do some calcs on the chart window and display stuff there.  I tried...