Download MetaTrader 5

MQL4 and MetaTrader 4 - page 191

To post a new topic, please log in or register
Hi, I am new, thanks for having me. This is my first post. I have a great strategy that works in real life, just trying to get it into code which I have learnt pretty much from scratch over the past few months. My coding skills are quite poor I would imagine compared to your standards, but I managed...
Hello comrades. How exactly can I retrieve only a cell in a record using the FileReadString() function? I have the following code. In the code I want to read only the second column of only the third row. How can I go about doing that. Thank you in advancevoid start()int AskDis;{string...
HAS ANYONE HAD THE SAME ISSUE?? I jsut opened a live trading account today with FXCm, and linked it with Metatrader 4, with which i can happily log in on my Laptop. However on the app, i use FXCM GBPREAL01 server, it says "connection closed due to invalid server name". Contacted FXCM and they can't...
My expert runs on the 15 min chart. However I want to check Stochastic values on the 5 minute chart When I do this I get results from the wrong time. eg At 3:15 on 22nd March I process the 3:00 candle on the 15min chart using iStochastic(NULL,PERIOD_M15,5,3,3,0,0,0,1) The 5 minute value at that time...
Hi, I have 3 indicators and I want to create a template out of them.Now I know how to do that.The problem is the indicator use 'EventChartCustom' ,which means the event subscription need to happen over precedence. For example   Indicator1 needs to first initialized so that it is ready to receive...
  Infinite loop (3)
Hello, I need get rid of infinite loop if((cmd==OP_BUY)&&(OrderProfit()<0)){      while(true)    {           result=OrderSend(Symbol(), OP_SELL, LOTS*2, Bid, 90, 0, 0, NULL, 0,0, clrNONE );                 if(result!=TRUE) { error=GetLastError(); Alert("Last1 = ",error); }      else...
Hi, I want to display the values of the RSI from the 1 hour chart on all lower time frames, and also the values of a Bollinger Band calculated on the H1 RSI. So both values come from the H1 chart. Could you tell me what I am doing wrong please? I can manage to display the RSI but the iBandsOnArray...
for (int i=OrdersTotal()-1; i >= 0; i--)    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))    {        if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)        {            double SL = NormalizeDouble(OrderOpenPrice(), NDigits);            double TP =...
Hi, I like to build indicators and strategies with ticks range bars , is it possible with MT4?   I thank you a lot     Robert
Situation: In a seperate window a couple of values, sometimes very different in value. Based on my user input I can reduce the visibility up to only one series. Problem: But the whole family of series still give there maximum and minimum to calculate the vertical range. Up to now I code a factor to...
Hi when I Compile I get no errors or warnings but still wont work :( any help?  I'm trying to get it to place a trade is the same direction if it was in profit or reverse if not. Based off last trade in history. extern double           LotSize=0.01;double                     pips;extern...
Hi coders, the H1 chart is open. Now I would like to have screenshots from H1, M15 and H4. I do it this way: ChartScreenShot(0, _Symbol+(string)_Period+".png", 1280, 720);ChartSetSymbolPeriod(0, NULL, PERIOD_H4);ChartScreenShot(0, _Symbol+(string)_Period+".png", 1280, 720);ChartSetSymbolPeriod(0,...
Dears, Does anyone know if an indicators similar to the 5Nitro+ indicator exist in this forum? I want to try it, but 200€ is a little steep for a trend indicator.    Thanks for your replies. 
Hello comrades, please consider the following MQL4 codes. The first function which is named "OpenWrite" is meant to write only one of USD or EUR, etc, to a text file. The second function named "OpenRead" is meant to read the content of the file. The first function actually writes to the file....
I recently purchased an Indicator from Market that I really like but I prefer it as an EA. Is there any way to code an EA to read an Indicator you place onto a chart?
  Delete pre-alert (14   1 2)
Hi guys. I have a problem I can not solve. I created this code where I have a pre-alert. Buffer1 and buffer2 are pre-alert, while the Buffer 3 and Buffer 4 are the real alert. I wish I could erase the dots of the pre-alert all the times that of Alert arrow appears. I made several attempts but did...
Hi, guys! I've got a brilliant (hm...) idea how to make money. Now i'm looking for the worst forex-trader on this forum. Somebody, who had a bad luck everytime he started trading. The real money-killer, that man I need! ;-) I'd like to set an automatic deal-copier at his account with a reverse...
Developed EA for MT4 using <link removed> . Code refuses to run. What can i do?  Any suggestions would be most appreciated. 
I have noticed that all my charts in mt4 using ichimoku, seem shifted when compared to browser versions of the charts provided by trading websites. Why are they different. Which is correct?
I am having issue with the attached EA trading multiple times per bar. I only want it to place max one trade per bar. I have tried to edit the code but it still seems not to work. Please could someone have a look and tell me where I have gone wrong? Many thanks.
Hi I am looking for the opinion of some of the experienced people on here. I have programmed a simple EA, and it seems to work fantastic on a demo account. I know trading live is different, but what I want to know is in what way is it different and could this difference have an effect on my EA...
I want my EA to only place up to 3 trades, and only once 1 manual trade is already open. Currently I have set up an external variable of TotalTrades and set this to 3. This is limiting the max trades to 3. I can't seem to work out how to set the requirement of 1 trade already open though. I...
I am currently building an EA to automate part of my trading system. However, I am unsure how to program one of the criteria. I only want the EA to place trades when all current open orders for the currency pair are all in profit. These could be both manual trades and EA placed trades. I believe I...
Hello,   i'm getting this error only in BACKTESTING, here's a pic.       As you can see i'm trying to close a Basket when a when an opposite signal is generated.   Here's the OrderClose() code for Sell orders, the same for Buy orders for(int i=0; i<OrdersTotal(); i++)        {...
Hi guys!   I run multiple times an EA at the same currency and same date but the report is different each time. The number that i look from the report is the Total Net Profit.     Sometimes the difference is not a big deal like the photos i upload  but sometimes has a big difference and make me...
New article Universal Expert Advisor: the Event Model and Trading Strategy Prototype (Part 2) has been published at mql5.com: This article continues the series of publications on a universal Expert Advisor model. This part describes in detail the original event model based on centralized data...
Hi Everyone.  I need help again, please.  I would like to incorporate the following into my EA, but it is completely ignored.  Why does the EA not call the Maxlots function?  When I run the EA on the Strategy tester, the Lotsize go much higher than my input.  Thank you.  EDIT:  Also I just noticed...
iMAOnArray returns wrong value when it is working on array passed as function's argument. The code below shows that iMAOnArray returns diffrent result for argument array and local array though they are equal.  It seems that iMAOnArray caches array data on first call of PrintArrayMA. loop0:...
Hi, I'm trying to alert for weekly High and Low price, I'm using this code:       double Alert_To_W1_High = iHigh(Symbol(),PERIOD_W1,1);      double Alert_To_W1_Low  = iLow(Symbol(),PERIOD_W1,1);      if(Ask+1*Point >= Alert_To_W1_High && Ask-1*Point <= Alert_To_W1_High)         Alert(Symbol() + "...
People thanks very much for the help. you help a lot and i am very grateful for the help in my learning.   In my studies, I'm trying to terminate an order if another order is closed.   Example SHELL:  if Order(1) OrderOpenPrice()-20PIPS then Order(2) CLOSE. I can not imagine how to program! please,...