MQL4 and MetaTrader 4 - page 77

A custom indicator included as a resource slow down 60 times tester against using the same indicator with the same inputs (not as a resource). Is it a bug? Or am I doing something wrong? Here is a simple EA so you can try it: #define INDI_AS_RESOURCE // If you want to run the EA without a resource
[Deleted]
Hi all, I'm trying to learn more about appdialog boxes. The final thing I wanted to learn was how to remove the MinMax and Close buttons from the top right hand corner. Shown in the image: So far I'm struggling big time with how to exactly remove them. I would input some code, but I don't really
Hi champs, This is probably a newbies question and please accept my appologies if it is, but I've been searching for a couple of days now and couldn't find any working code to close all my open orders at a certain time of the day. Below is an extract of my EA in MT4 and I've tried several pieces of
Hi there:-) I'm new to coding in MT4 and would love if someone would be so kind to guide me in the right direction:-) I have attached an indicator that works brilliant... It automatically saves a screenshot when you open and close a trade... My problem is that i would like to set a custom folder
In MQL4, the following trailing stop loss function, why the order will be continuously modified within the same 1 second? The effect I want is to adjust the SL position by 100 points every time the profit increases by 100 points. Is there anyone who can modify it for me? Thanks! datetime
//+------------------------------------------------------------------+ //| test1.mq4 | //| Copyright 2023, Frank Harey | //| https://www.mql5.com |
  Custom Indicator  (2)
Hello! I have a problem with getting the values for an indicator into a script. It is about ZigZag indicator , I am only getting the values for the default inputs as setted in the indicator. If I change the input in my iCustom function it will not have any efect. This is how I get the indicator
I have an EA that only works on H1 timeframe, is there a way to: - Automatically change timeframe to H1 when EA is attached succesfully to a chart? - Disable the abiility to change timeframe while the EA is attached to a chart. Thank you very much!
  Trades open once  (1)
I want to hedge my trades multiple times instead of once. For example If price opens at buy 1.12345 & sell at 1.12295, how do I hedge my trades at that price multiple times? int MagicNumber=87897; int BuyTrade= 0 ; int SellTrade= 0 ; int Direction= 2 ; int Hedge= 0 ; double Filter= 0 ;
//+------------------------------------------------------------------+ //| RSI_MACD_Stochastic.mq4 | //| Copyright 2023, MetaQuotes Software Corp. | //| https://www.mql5.com |
I'm just messing around with this custom indicator where I am trying to inherit CChartObjectRectangle and add some methods to it. I am not sure how I can create the custom object and keep calling the methods associated with the object in the different e vent handling functions. If I store pointers
may i request a page or any type of list that contain all MT4 Brokers link in onepage? maybe in a sticky topic or a new MT4 brokers page thnx
[Deleted]
Hello everyone, as you know by default charts on mt4 load x amount of history on chart based on settings/broker availability. My question is, let's say I'm on 1m chart and on platform settings I set "maximum bars on charts" to 100k. Then my charts will contain likely 20k bars because of most broker
Dear Friends; I want my Expert Advisor to make trades based on the RSI value in one direction only (up or down trend). How can I add the following logic to the EA code in MetaTrader 4? If RSI > 50 in Timeframe D1 ------> only long positions allowed If RSI < 50 in Timeframe D1 ------> only short
Hi All I am trying to get the consecutive number of losses from within my EA. The number does count up but when i get a win ,either on buy or sell the counter does not reset. Is there something wrong with my code? void BuyCountLosses(){   int LossBuy =0;       for( cnt = OrdersHistoryTotal() - 1;...
Hi... I have an mql4 class and I have compiled it in meta editor on another pc successfully. But in the other computer, I keep getting errors like "'OP_BUY' - undeclared identifier" or "'Ask' - undeclared identifier". It seems that the editor tries to compile my file with mql5 compiler. How could I
I'm developing an EA to place trades at certain points relative to an indicator. It places the trades only sometimes at those certain points. I have the EA setup to trade according to certain buffers in an indicator. According to the data window in the indicator those dots only appear when they have
Hi i need your help, I need to draw an arrow on the next bar and not on the current bar which is drawn by this indicator. What could I modify? Many Thanks. #property indicator_chart_window // The number of buffers for calculation, up to 8 #property indicator_buffers 2 // The color for displaying
Anybody know how to fix a failed [Common error]? My EA did a sell trade which is successfull previously and now when it tries to place a sell trade again, it has a failed [Common error]. No problem with the buy order. I have search in the metaeditor documentation and this forum but it doesnt do much...
Hey guys I was wondering if their was an indicator or EA that would copy a trendline on multiple charts if drawn on one. example, if i drew a line on a eurusd 1 hour it would come up at the same level on all other instances and time frames of eurusd thanks
  Error  (2)
#property indicator_chart_window #property indicator_buffers 3 extern string pair1 = "EURUSD"; extern string pair2 = "GBPUSD"; extern int period = PERIOD_H1 ; extern int distance_type = MODE_EMA ; extern int distance_period = 20 ; double dist_min[]; double dist_max[]; double dist_avg[]; int init()
Can i only delete and reopen it
I have 2 EAs that I intend to use to gather custom data by running the EA in MT4 strategy builder and a CSV file is dropped containing the data. the file is working fine except for saving the OHLC data. It is saving the same price all through OHLC per one timestamp. See below: time open high low
I have an EA that places BuyLimit and SellLimit trades. Most of the time there is no problem and the trades are placed successfully. But every now and then there is a trades that refuses to go through and ndlessly giving an "invalid stops" error. The problem is I define NO specific SL or TP. They
  close price  (1)
hello everyone, i have 5 min bar which divided into 5 bars of 1 min, how can i get the close price of all one of that bars of 1 min
Hello everyone, I'm trying to calculate the summation between 2 Histograms in different timeframes and fit it in the lower timeframe, but my code is not perfect. could anyone help me reversion my code, please
Is there any way to set up an EA based on an indicator that I don't have the code for. The indicator draws lines on the chart and has dots for buy and sell signals. Is there anyway I can make an EA that buys or sells on those dots
Is there any function which returns the overall average win amount, average loss amount, and winning/losing trade fraction? I'm thinking about implementing a kelly subroutine to handle position sizing and would like to make it fully automatic (to be turned on by user after sufficient history is...
bool sendImage ( string symbol, string tf) { string fileName = StringConcatenate (symbol, "_" ,tf, ".jpg" ); Print ( "FILENAME = " + symbol); string fileType= "image/jpg" ; int res; // To receive the operation execution result char data[]; // Data array to send POST requests
//+------------------------------------------------------------------+ //| BINARY MT2 TETSING.mq4 | //| Forex trading | //| https://youtube.com |