MQL4 and MetaTrader 4 - page 2

With my code below I can identify Bar 6 on the image above. How do I calculate that Bar 5 4 3 2 1 is still inside bar 7 ? for ( int i= 0 ; i<limit; i++) { dCurrent=High[i]; PrevH=High[i+ 1 ]; CurrH=High[i]; PrevL=Low[i+ 1 ]; CurrL=Low[i]; if
I changed a little on the official RSI indicator, but it does not work. No error in compile. Please anyone give some comments. Thank you
I'm looking for any solution to refresh or update the Expert Advisor programmatically and automatically whenever change the file .ex4. I found a tip to use a GlobalVariables but I do not find any example to do that, by the way, I found this https://book.mql4.com/variables/globals but it does not
I'm trying to save supply&demand zones, now i'm not sure how to do it. I was considering 2 options (but if there's better ways let me know). OnTick(): Loop through the past x amount of bars, and draw in all the zones, fill it in a 2d array or something, clear again at every tick. OnTick(): Just
  Variable problem  (2)
Hello to all, For some time I have been trying to get the number of consecutive maximum losses at the end of my backrest in a variable but my program returns a completely different number than what I see in my program... here it is: double OnTester () { MaxConsecutivesLoss =
Hello I am quite new in mql4 programming and recently I build my own EA which should execute pending and market orders at a specified price. So, this is the code I wrote and yeah there is so much junk, but it works. The only problem I am facing is when I look at the results after running the EA I
Hi guys im doing this EA but using date, time and timezone confuses me. Can you help me make a function that will return true if its New York Session or return true if its the first 3hours of New York Session? Thank you so much :)
Hello guys. Iam trying to count current profit for all buy/ sell open orders. I got so far: double CheckBuyProfit(){ double profit=OrderProfit() + OrderSwap() + OrderCommission(); if ( OrdersTotal ()> 0 ){ for ( int i = 0 ; i < OrdersTotal () ; i++ ) { if (
The following example is using iBarShift for parsing datetimes 🙂 input int Hour_shift=-5; //Hour shift input int Hour_start=1; //Start hr; 0-23 input int Minute_start=0; //Start min; 0-59 input int Second_start=0; //Start sec; 0-59 input int Hour_end=9; //Stop hr; 0-23 input int
The Code is working 99% properly my real Problem is the While Loop I use it that way: while (bar< Bars - 1 ) But the way I need is: while (highNumber>Close[I+ 1 ]) But when I use it that way the whole System crashes. Pls See my full code: //--- //Special Loop to avoid Array Out of Range int
Hey coders, sometimes I need a tick, may it be on a weekend or during quiet market times. I thought about forcing a tick by calling OnCalculate() from a chart event. This was my first idea: void OnChartEvent(const int id,                  const long &lparam,                  const double &dparam...
hello traders i hope u are in good health i have a question for making indicators and experts secure for the market, because I want to upload my own. if somebody pays for my indicator, he can download it as ex4-File. now he can take an ex4>mql4 compilier and delete the limitation for his account and
hi i am making an EA that will send order only on new york session, but im confuse on how will my EA know if the time now is in New York session. What reference or function do i need
Right, so one again, and for the millionth time in a day (because God forbid should my life just be easy for five minutes) MT4 Freezes every time I load an EA onto a chart. Any thoughts? Or is my platform has just decided to say "Oh, yes, I remember you - I'm going to be an arse today & make your
Dears, I have been trying to achieve this one-way communication between two sperate account in two different brokers.. I even tried to make those two accounts within the same broker but still no feed is being sent through, not even the error messages being displayed. Sender #import
Morning folks! I have a TFJ here. I am literally incensed right now. I am absolutely fuming. The stupidity of the way in which MT4 handles my EA is beyond me, and how on earth anyone could release an application onto the market is nothing short of amazing. I have been coding for 4 years now and I
  open trades every new candle  (11   1 2)
Hi, i want to open an order of every new candle lets say on H1. i wrote this code, but it always wait for close on opened order. I mean i want open 24 orders per day (H1 TF).   //+------------------------------------------------------------------+//|...
Hi I am trying to code a method to avoid volatility either side of Non Farm Payrol (NFP). I would like to be able to select to trade or not trade the following. 1. Trade or not Trade NFP. I have this code that seems to work extern bool NFP_Friday = true; if (DayOfWeek() == 5 && Day() < 8 &&
Hi all, For performance reasons in the backtesting I' trying to transfer an indicator to my EA code. So reading the Topic on TRANSFERRING AN INDICATOR CODE INTO AN EXPERT ADVISOR CODE. INDICATOR STRUCTURE I'm still not getting a good result. The custom indicator that i'm trying to transfer is HMA in
Hello Unfortunately, I decided to migrate to a different laptop with a new windows 10 installed  The manufacturing are becoming fans of 64 bit operating system. Therefore, they sell their new product with one option ( 64 bit ) operating system and backup. Means you don't have a choice to choose...
MT4 doesn't show some HST files which are in the history folder. The file is there and ready to be displayed but mt4 doesn't show it on the "open offline chart" list. Any idea? Matteo
I am not able to make web request to an API using WebRequest from a script, I always get back an error 5203. This is the code, that I think is as simple as it can get. I am using MT4 build 765. #property copyright "just a test"#property link      ""#property version   "1.00"#property strictvoid...
Hi, I'm posting a https request in my EA but the WebRequest returns -1 with error 5203 ERR_WEBREQUEST_REQUEST_FAILED. What do you think the problem is?   Thanks,  Ala 
Ok so I had my MT4 account set up and sending signals to my telegram account just fine and it stopped last night and now I'm getting a EA error code 5203? can anyone help me
Hi, i'm trying to create an EA that enters a trade depending on whether the signal line is above or below the main line on the stochastic indicator. I would like it to close the current order when the lines cross but I do not know how to do it. I am using an optimal lot size calcultor so each trade
class CPivotManager : public CObject  {   CObjVector<CPivotCandidate>_highPivots;   ...void CPivotManager::Tidy()  {   for(int i=0;i<_highPivots.Total();i++)     {      CPivotCandidate *candidate=_highPivots[i]; <-- Invalid pointer access?      if(candidate.GetIgnore() && candidate...
Ok I have had it with the error coming up in my EA. I am getting 'invalid pointer access' here is the what happening.. 1. before i use any obbject is use if (CheckPointer(obj)==POINTER_DYNAMIC)||(CheckPointer(obj)==POINTER_AUTOMATIC) the conditions passes and then I proceed to get the 'invalid...
Hi, i have an expert advisor that works, but sometimes i just recieve this error, can someone help me out on how to fix it
[Deleted]
Hi I have seen If two object crossed with each other then the cross section get white or in other color. Is there any way to avoid that?   I don't want the white area, I want it to be full blue. How can I do that? One thing predicting object cross section are is not possible as its dynamic. Regards...
Hello Everybody, when i set rectangle objects that overlay, their color mixes up like they are transparent. However, how can i change that, so the color stays the color i set up for the rectangle? really annoying ... thanks for any help!