Download MetaTrader 5

MQL4 and MetaTrader 4 - page 318

To post a new topic, please log in or register
Hi Everyone, I am writing an indicator based on 2 variables. The rule is that: Whenever variable1 (take value 0 and 1) turns to 1 from 0. find the very first bar (including this turning bar) that has variable1 =1 and varibale2=100. It is like looking back, and I choose to look back 5 bars. My...
Hey guys, I want to do a simple thing.. Just move my stop to breakeven when the trade is the same amount of pips in profit. That's all. And whatever I try, I always get error 130. I don't understand why this is an invalid SL? Can anyone help? void OnTick()  {//---   for (int i = OrdersTotal()-1; i...
How do I issue the SendOrder command for a Buy Stop with the Limit set 1 tick above the High and the Stop Loss set 1 tick below the Low? I tried the following: res=OrderSend(Symbol(),OP_BUYSTOP,.5,High[1]+MathPow(10,-Digits()),0,Low[1]-MathPow(10,-Digits()),0,"",MAGICMA,0,Blue);...
Guys, I've spent days reading posts about running an expert on an offline chart, fake ticks and all that trying to find out if it is or not possible at this stage to get the start function of an expert on offline chart triggered. I couldn't get a straight answer anywhere. The documentation doesn't...
Hello to all, I have a humble request. Can someone change this indicator to window chart arrows please ? I just want the arrows on the chart (above/below candles). If not, can someone, at least, help and guide me to change it to this way i want ? Thank you very much. Regards.
MetaTrader 4 Client Terminal build 646 has been released. It contains the following changes: Terminal: Completely revised built-in search. The new search is a smart and powerful system. Search results are now conveniently arranged by categories. As you type in your search query, the system...
Hi folks, I've been working on a signals indicator similar to the tutorial available here: https://www.mql5.com/en/articles/1503 I've managed to incorporate my (simple) trend definition of 2 MA's and that is changing the signal to green & red accordingly. For a second signal, I'm attempting to...
Well, thanks to the latest builds (600+) of MT4, we can now easily get this information. Here's the code: void OnStart()  {//---   int HowManySymbols=SymbolsTotal(true);   string ListSymbols=" ";   for(int i=0;i<HowManySymbols;i++)     {      ListSymbols=StringConcatenate(ListSymbols,SymbolName(i...
  Daily Pivot Shift (13   1 2)
I have an EA that can shift the Daily Pivot according to differing times for the close of the candle. Is there a Close Time that the majority of traders around the world use? There are 6 main Options that I have either heard of or could think of. ... 6 Possible Close Times for Daily Pivots: 1)...
I copied roc.mq4 from https://book.mql4.com/samples/iroc exactly the way it is then attached it to a chart and I don't see any lines there at all. Why?
Hi All I have problem to modify Take Profit and I need help; I am openning 2 orders on the same direction, but when I modify them I can modify only one. I open 2 Orders in the same price calculate the stoploss and then calculate take profit, one order TP should 1:1 RR and the second 1:2 RR. I can...
Hi guys, I wrote expert and I want to limit it for 30 days limit and then it will not work. or limit it until specific day. Anyone know how can I do that ? Thanks in advance.  Eyal  
Hello! I need to update my DLL because of changes in build 610. My old DLL and EA compiled before upgrade to 610 works fine in it. But I am not able to run even the simplest new expert + DLL now. I am using Visual Studio 2010 and C#. DLL is compiled as 32bit. Operating system: Windows 7 Prof 64bit...
I would like to find the price difference between the outerlines of a Standard Deviation Channel. The points that are marked A and B. Ican find the price and time of the center line but this doesn't seem to behelpful. I've also explored using iStdDev. Does anybody have an answer how tofind the price...
Please help me calculate rollover, i`m so confused about it. So here is the formula that my broker has on its site Rollover= Swap rate / 10000 * [POSITION SIZE] * [NR OF DAYS] And for Yen Rollover= Swap rate / 100 * [POSITION SIZE] * [NR OF DAYS] I also saw on other sites other formulas like:...
Good morning, I write a simple EA below to run my indicator   if (lastCandle != Time[0])  {   if(iCustom(NULL,0,"MY_INDICATOR",0,1)==2)       {  buy=Close[1];         sl=Close[1]-0.01;         tp2=Close[1]+0.01;         tp1=Close[1]+0.01;      }      else buy=0;  I find that this trading will run...
  I want to deposit funds directly into my MetaTrader acct. Can I do this or do I have to transfer funds from my TradeStation acct.?
Hi I wrote a simple indicator to show an alert when price breaks out of either the high or the low of the previous day's candle or the previous H4 candle.   It seems to compile Ok but the problem is, every time I close and then restart MT4 the indicator disappears. I've shown the code below (I know...
void DrawAllert(string text, color C=LightGray)    {    ObjectCreate ("rect",OBJ_LABEL,0,0,0,0,0);    ObjectSet ("rect",OBJPROP_XDISTANCE,10);    ObjectSet ("rect",OBJPROP_YDISTANCE,20);    ObjectSetText ("rect",text,10,"Times New Roman",C);    }    bool IperComp (double stochastic1now, double...
Hi Everyone, I cannot understand why the following structure doesn't work. When I attach to chart, ONLY buffer buy has value. To my understand, it will run the 2 sequences one by one. So the first FOR() will be fully run first  --> I have buy buffer. Then the second FOR() will be processed. (it is...
Hi, I have to send and will receive ASCII - code from/to the other side of a named pipe. Here https://www.mql5.com/en/docs/constants/io_constants/codepageusage I found lots of encodings - but which one is the old fashioned ASCII ? Thanks in advance, Gooly
Dear Traders , Please help me to call this indicator in to an Other Custom indicator I create, some problems I face now, iCustom(Symbol(),0,"FractalZigZagNoRepaint",ZZDepth,ZZDev,0,i) '0' Buffer For BUYiCustom(Symbol(),0,"FractalZigZagNoRepaint",ZZDepth,ZZDev,1,i) '1' Buffer For SELL I have Added...
Mind some discussion on the MT4 terminal features? Let's help MetaQuotes! They made an impressive progress on build 600 but still what boils your blood? My evaporates when cursor loses control of an cought object, eg. vertical line, when moving outside the chart. Instead, the whole chart is flying...
Hi, as fas I remember that functions that are not used by the e..g. EA are not included by the compiler and I could see the compiler-message, which functions has been eliminated. Now I don't see those messages any more. But is it still true that 'useless' functions are 'ignored' by the compiler?...
  please help assistance (13   1 2)
please my broker changed their order symbol to ERU/USDX or GBP/USDX and my ea can not trade again please can someone tell me which line of code to change to get it working again.please i really needed it urgently.thanks
Problem – Object Search Time I refer to my previous post titled Feature Request - Access Global Variables By Index. There is also a similar search time problem with objectfunctions which use an object name to locate an object on a chart. EA creates, modifies and deletes a significant number of chart...
It seems that OBJPROP_RAY_LEFT is unavalible?  ObjectSetInteger(0,StopLoss_Line,OBJPROP_RAY_LEFT,true); It doesn't take any affact and I can't find it in the documentation any more. Is there any thing i missed?     
Hello, ever since upgrading to build 600+ and the new editor, I've been experiencing horrible delays when coding. Previously it worked just fine, but now when I'm typing in the editor there will be a delay of up to 30 seconds before what I typed actually appears. The odd part is that it seems to be...
I am new to working with mql4 and I have ran into a small issue that I am not able to get fixed! As I use the code before every time it try to sell it gives me the error #130 which means invalid stoploss. But I don't understand what is wrong with the code to cause that. [code] extern double...