MQL4 and MetaTrader 4 - page 347

Gentlemen. Those who have been in the business for a long time are probably aware of the myth (or fact) that 99% of forex traders lose their money. I suddenly wondered. But is it real to earn anything? I mean direct trading. What is the point of this topic. The point is. I've been in this field for
Hi, could somebody tell me how to print the diference in days/hours/... between OrderCloseTime() and OrderOpenTime()? Thanks
I've consulted the article on casting, https://www.mql5.com/en/docs/basis/types/casting and seen some other responses on this forum, but this particular instance seems different, possibly because it contains an array? The affected line is highlighted.  You can see that TradeList and ctTrade have...
[Deleted]
ResetLastError (); int filehandle= FileOpen ("history_1.csv", FILE_READ | FILE_CSV ,';'); if (filehandle!= INVALID_HANDLE ) { Print (" FileOpen OK"); } else Print ("Operation FileOpen failed, error ", GetLastError ()); long GetValue = FileGetInteger
How do you convert your indicator to non repainting indicator?
Dear Coders, I am Newbie here, learning mql4 coding, today i have mixed some indicators and created a MTF CCI indicator, It's not showing any error or warnings, and also not loading in MT4 please rectify it....
Hi guys, need to get x and y coordinates of the chart in visual mode. Is there any way to do this? I use ChartXYToTimePrice() in real mode and I call this function in OnChartEvent to get X and Y coordinates by click on chart. But OnChartEvent() is not working in strategy tester - visual mode .
Olá,   How can i do to add friendly labels for enum options? See my code below, i used 2 external parameters with enum: AppliedPrice and TradeMode. The first uses a language native enum (ENUM_APLIED_PRICE)  e the second uses an enum that i created myself (ENUM_TRADE_MODE).  extern ENUM_APPLIED_PRICE...
Hi folks was hoping someone could please help me understand what could be going on with my EA. I wrote and EA that takes trades based on the rsi. If the rsi is below 30 it sells and if above 70 it buys. Now the EA works well on the tester for weeks and then suddenly without changing anything in the...
if( 6 && 7  >5) // WORKSPrint("NO PARENTHESIS Yes");if( (6 && 7)  >5) // DOESNT WORKPrint("PARENTHESIS Yes"); Why does first case work and second case doesn't?
Hi guys, I am working on an EA, that uses a break even function.  It uses a for loop to select the orders and make operations with them. void Breakeven()  {   for(int i=OrdersTotal()-1;i>=0;i--)     {      if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))...
Comm= Comm +"StringToT"+ StringToTime(TimeCurrent() + 60*60,TIME_DATE|TIME_MINUTES)+"\n"; But  Comm= Comm +"TimeToSMath"+ TimeToString(TimeCurrent() + 60*60, TIME_DATE|TIME_MINUTES)+"\n"; Works.
Hi, I've searched the forum here and all articles I find are already several years old. I'm looking for a solution to publish MT4 and MT5 trades information (open, pending and closed) to a website (via MySQL database). Trade information published should follow the possibilities offered by MyFxBook...
Hi I'm new in MQL4 programming... I want to view "current time" in debug mode of MQL4 programming EA ...... is this possible? Maybe with object OBJ_VLINE? I'm try with: datetime LineTime=iTime(Symbol(), Period(),0);ObjectCreate(current_chart_id,obj_name,OBJ_VLINE,0,LineTime,0) but not see nothing......
Hi,  I have an indicator that shows the net wick for the candle, the problem is that it does not autorefresh and to do so I need to change the timeframe The code is the following, please let me know what to do to change it please #property indicator_separate_window#property indicator_buffers...
I know I can assign hotkeys to indicators with Set Hotkey ,but I was wondering if there is a indicator or ea that can assign shortcuts to indicators and can turn them on/off using the shortcut . And ideally that shortcut would be just one key , say i press one key like M and i get a moving average
So let's say I see a scalping opportunity on the 1m or 5m time frame, and I want to get in quick . To get out quick is not a problem,just press the x on the trade. But to get in, even with a stop order i still need to set a stop loss ,calculate the lot size according to the stop loss and the risk...
Is there a way to sleep or disable trades on specific pair while running 1 EA?
  Sleep(4.32e+7); // - 12 Hours   Sleep(2.16e+7); // -  6 Hours   Sleep(1.08e+7); // -  3 Hours
Hej Can anyone help Haw can I get an sounds alert have seen one had a spech alert at trade is being open an closed on MT4
Hi there guys. Can someone help me and tell me how I can change this indicator to use ONLY 1minute timeframe data in it´s calculation, regardless of timeframe it is loaded in? Those are pascal willain effective volume formula, but the code is not correct because Pascal uses 1 minute data for the...
How do I solve a metatrader 4 slowdown on the accelerations of the nasdaq and the market in general? Hi everyone. I have the metatrader that keeps crashing for 40 minutes because the market is in turmoil. I put less indicators and in 8 seconds it opens but stops and...
So say I do Alt+R and I have 6 charts open at the same time on my screen. How can I select all of them at the same time so when I want to change the time period it changes for all of them , or say I want to apply a template to all of them in one click . And another question . Say i have gbp/usd
I tried get the bars between two ma crossed but it not reset and start from 0 it's looping ever please guide me in right direction
  mt4  (1)
my mt4 has been stuck on update for 2 days I don't know what to do
Hello, Please forgive my ignorance with all of this. I have started to learn mql4 a couple of days ago and I have no previous coding experience. I was very proud of my first script when I realised that I misunderstood how scripts work. Of course what I need is an EA. The basis of what I need it to...
Hi Guys Im new to coding but does anyone know why my sell trade is opening and closing on entry. Ive put my code below feel free to stick it into MT4. #property strict     //Always Keep// FIND OUT WHY SELL ARE NOT WORKING AS EXPECTED //.............Input Variables.......................................
As the title says, I'm in a rather dire need of an EA/indicator for MT4, that alerts one when an X pair is above X amount, E.g. a pair EURUSD (and only EURUSD) is currently at -20 in Profit/Loss from 4 trades. The said EA/indicator is set to alert one when Profit/Loss reaches an...
Need to compare every single bid of last month for some calculations (about 2 million values just for EURUSD alone). Putting them all in an array (need to do so for 31 instruments) seems too clunky. Any better way? I have been just writing bids to a file, then using bash on the file (where I can...
Hi, I am trying to write an indicator and have run into a problem with getting it to compile. I would really appreciate any help anyone can give. The indicator checks that :- MA's on 2 timeframes are aligned the last 3 closed candles are all higher or lower than the previous candle At least 1 candle