MQL4 and MetaTrader 4 - page 122

To post a new topic, please log in or register
Hi, In multiple chart applications, how do you get the objects value of a chart other than the current one?!!! thanks...
hi all I have 830 euro on the micro account with lever 1:30 to want to trade eur / usd can I have margin problems? How to calculate how much margin do you have to hold a position with x micro lots?
int start() {   int limit, i, counter;   double RSI, RSIp, CCI;   double Range, AvgRange;   int counted_bars=IndicatorCounted();//---- check for possible errors   if(counted_bars<0) return(-1);//---- last counted bar will be recounted   if(counted_bars>0) counted_bars--;   limit=Bars-counted_bars;...
Hi, i'm using MQL4 for a customer.  I saw that it is possible to compile with the cloud protector in the editor. My question is simple, does it work with MQL4? I ask why it is written "Compile with MQL5 cloud protector" even though I have downloaded Metatrader 4.
Hi all, I am a new one on the mql4 programer. I try to write an EA. I have a table called updated_Q with 6*6 matrix (updated_Q[6][6]. This table is updated in EA according to some rules. I want to write it my file called updated_Q as csv. However, I don't know how I can do this. Can you help me...
Hi, Im trying to make an indicator that will identify conditions when the market is ranging. I want to use the squeeze of the bollinger bands to tell me when the market is ranging. Can anybody help me with a peice of code to do that? I can finish the rest of the indicator myself I just need the...
its nearly impossible to connect to the mt5 trading server when i using wireless network,anybody else have the same problem?or maybe something wrong with my network...
  Lot size (24   1 2 3)
Hi everyone, I aim to code something saying that only 80% of the position will be closed when reaching TP1. I am scared that the value will not accepted by the broker. Ho to tell the EA to choose a value around 80%.. Do you have any suggestions? or link to help me through this step. Thanks for you...
Good evening everyone, I would to code something corresponding to this sentence "if the currency pair on the current chart is one of those : USDJPY or EURJPY or CADJPY". Is someone can help? Luciole
How to make an indicator use the Close or Open value of another indicator (that is in a separate window) such as a Stochastic or RSI, instead of price?? (in mql4) Thank you.
hi guys whats up i wanna to write code in buy open buy after price moved up 7 points in 5 secound open sell after price moved down 7 point in 5 secound thanks alot
Hello, I wrote a bot that should open ten BuyLimit Orders. The BuyLimit Orders should be max. 0.00010 under the Ask price with an distance of 0.00001 of each other. That works, but there shouln´t be an takeprofit twice in buy or buylimit orders, but it happens. Something doesn´t work in my check....
From the technical documentation of iCustom  https://docs.mql4.com/indicators/icustom It is said that the return value is "Numerical value of the specified custom indicator"  Returned value Numerical value of the specified custom indicator. The custom indicator must be compiled (*.EX4 file) and be...
hello I have a EX that hast many inputs. (60 inputs). with a particular inputs I have a very good result in back testing of 6 months ago. but  in back testing of 7 or 8 months my results are not good. how can I find the best input values?
Hi guys, I'm having issues with the iCustom command. Basically it's working sometimes and not others, which I find a little bizarre. Here is my code. bool Scan_Super_Trend()   {   ArrayResize(Value1,7,7);   ArrayResize(Value2,7,7);   ArrayResize(SuperTrend,7,7);   ArrayResize(STDirection,7,7);   i =...
As laid out by @whroeder1 in https://www.mql5.com/en/forum/158597 I have added some code to scale overlays I am drawing on top of candles. Unfortunately I can't seem to get it overlaid as I would like. I have tried the original code, and I have tried tweaking the width for SetIndexStyle() based on...
PlotIndexSetInteger(0,PLOT_SHOW_DATA,false) , its for mq5 . what is Equal for mq4 ?
  Help with EA (1)
Hello, Recently I found a website called forexeadvisor.com which creates the code for a custom ea. I put in all the parameters for the indicators I use while manual trading, as I would like to automate this process. After compiling the code, it came back with a few warnings and made 0 trades. Was...
what is wrong with this c# code. I am using TradePlatform.mt4 api:  double bid = 0.0;  double ask = 0.0;  double balance = 0.0;  int ticket = 0;  bool connected=false;  Bridge.InitializeHosts(true);  terminalA = Bridge.GetTerminal(12773749, "EURUSD");  terminalA.MqlScope(mql => connected=mql...
Hi All I am posting here a very effective and simple trading system originally based on 5 min charts but extendable on other time frames also. It is based on MA price cross which is confirmed by the MACD. I took this system from the e-book High probability Trading setups. It uses a very effective...
How can I create a switch that can make me change from fixed size lot to position sizing based on account balance or %risk. Please I need some help . 
Hello, I am testing MACD expert advisor in MT4.  Before making any changes to it, I'm using standard settings from the MACD that comes with the MT4 application. I get no results though. The 'Optimization results' and 'Optimization graph' tabs in the tester are empty. On the 'journal' tab I get the...
Hey, guys, is there a way to save all open charts and EAs placed on them? Let me explain. For example, if a have two accounts, with different strategies, is there a way that I can save and restore all open charts in MT4? Or do I need to rebuild the estrategies each time a I change from one account...
I want my EA to print arrows on the chart to indicate where a trade was opened/closed. Is there anyway that we can draw multiple of the same object at different points in the chart? For example I might want to create an arrow on the current bar: Created = ObjectCreate(ChartID(),"Sell_Arrow"...
Hi I have an Array which contains names of variables. Is there a way to use the Array entries to assign a value instead of having to do...                      if (Per_Array[i,0]) = "Ind0_DonchianPeriodsEntry"                         Ind0_DonchianPeriodsEntry=GVResult                      else...
Hello all, i am writing a "Master Candle" indicator (on H1). Master candles are highlighted, but now, i need to draw high and low trend lines until the price break these high or low. Then the trendline are stopped to be drawn on the (H1) candle breakout. How can i do that  please ? Here is my code :...
This trade incurred a loss of 1 pip on a 1 lot. The loss should therefore equal -10.00 (the spread) , however the loss appears as -7.56 in Account History. There are no commission, tax or swap charges on the trade, so how is it possible for the loss to equal this amount?  Order Time Type Size Symbol...
Hi all, I would be very gratefull if someone could help me by advising how to implement a snippet of code in order to let my ea have an interval of a certain period between opening positions. So I want it to never open more tahn one position at a given time. Let's say 20 seconds So now it operates...
Hello, So im trying to call iCustom on an indicator i found here :  https://www.mql5.com/en/code/19153 As you can see this indicator was adjusted from another to add some improvement including being able to call iCustom to have a signal when a divergence is spotted (4th buffer : Signal) But when i...
Dear Coders, I need your help. By "Specific" I mean Time Window. I would like to count BARS from 13:15 to 20:00 that are Higher and lower than the High/Low defined from 12:00 to 13:00 for every day. I tried this: double HH,LL,highest,lowest;for(int i=500; i>0; i--){if (TimeHour(iTime(NULL, 0, i)) ==...