MQL4 and MetaTrader 4 - page 438

  MQL4 Workshop  (18   1 2)
Hello there, I am new to this forum and I am wondering if any of you would help me make it possible for this topic to become free for all, not profitable, collaborative, and educational. The thing is I got hooked with the automated trading around a year ago, and yes I bought some of them and ended
I'm developing some tools that requires by default to have a 0 value so the trader can customize them but I'd like to know if there's a way to set on a double value a default message like "Input here the TP value" or something like that?
  Kaufman AMA break out EA  (77   1 2 3 4 5 ... 7 8)
First a description of reasons for making this EA (apart from the obvious ones ): _________________________________ Due to coders laziness I guess, or due to ignoring the possible errors in EA execution, EAs with proper code execution error management, order exceptions execution and error...
Hi. I am trying to understand the ordersend function. According to the MQL4 reference documentation, it takes volume as a double e.g. OrderSend(Symbol(),OP_BUY,1.5,price,3,stoploss,takeprofit,"My order",16384,0,clrGreen); where 1.5 is the volume to buy. Some brokers use 1000,10000,100000 size lots....
  indicator index  (2)
Hello , 2 indicators are initialized in main chart  by these set of instruction. double ExtMapBuffer1[];                         double ExtMapBuffer2[];                         int init(){      SetIndexStyle(0, DRAW_ARROW, STYLE_DOT, 1);    SetIndexArrow(0, 233);    SetIndexBuffer(0,...
[Deleted]
What is the actual reason of "indicator is too slow"? I noticed that adding an artificial delay (10-20 sec) in OnCalculate does not cause the appearance of that "too slow" message, therefore, the reason is not in the long calculation of an indicator.
[Deleted]
for(cnt=0;cnt<total;cnt++) compare to (cnt=0;cnt<=total;cnt++)? As I was trying to use CloseAll(), I found that the typical one (first one) providedby CodersGuru didnot manage to close all and one open trade was left unclose. in addition; any different for: OrderSelect(0, SELECT_BY_POS); vs...
Hi A mql4 code changes the chart symbol using the "ChartSetSymbolPeriod" method. And since the chart has an indicator, it takes a second or two to render the indicator onto the sub window. Is there a call back which gets triggered once the indicator finished rendering so that I can do other stuff?...
HI can some one fix this EA its not opening any orders. EA MQL4 Scrip is attached bellow please help me with the code strategies i copied from indicator i want to send buy orders when new signal comes.  I have a equation too in mql4 can i do this? int start()  for(int cnt=0; cnt<OrdersTotal();...
[Deleted]
I've got an EA that I am trading on 4 pair. I know by using OrderTotal I can restrict the number of orders opened at a give time, so I have it setup so only 1 order can be opened at a time. How can I set it up so that 1 order can be opened PER PAIR?
I have written an indicator but it is not performing the way it should. The problem is that the indicator does not take into consideration the higher time frame (H1) when posting the BUY and SELL arrows on the lower time frame (M15) chart. If you can fix this we will have a fantastic indicator! Here...
[Deleted]
Hello everyone, I am recently trying to predict MACD signals and i think its going well. the problem is that i want to draw it in the indicator window but haven't been successful so far. So consider i can have all the candles needed in order to calculate the iMACD ( NULL ,0,12,26,9, PRICE_CLOSE
The code line below is expected to print out 1 since I have the Stochastic indicator attached. but it prints only the text "indicator short name is: " Any idea how to get the short name of the indicator? Print("indicator short name is: " + ChartIndicatorName(0,0,1));
If i resize an array which already contains data, will this erase all data or just add an extra slot? i.e., is ArrayResize({1,1,1},4) = {1,1,1, NULL}
[Deleted]
Hello everybody. I would like to see if you can help me with a problem i've been having. if(existeOrdenSell() == false){   orderSend(...);}if(existeOrdenBuy() == false){   orderSend(...);}bool existeOrdenSell()  {      existeSell = false;      for(int i = 0; i < OrdersTotal(); i++)      {...
Hello, I have a problem with using Global Variables. Thanks for taking a look. The requirement is fairly simple (i think), but for me it is difficult to implement. I have tried myself and hired programmers from around the globe, some have a go at doing it but don't actually code what i need or they
Hello, I have a few questions about running EA in MT4: If I want to run an EA on many currency pairs, do I have to drag-n-drop it on every chart? Is there a simple way to run it on many pairs even if some of them do not have chart displayed on the terminal?When an EA running on multiple currency...
Hello Everybody, I'm new on MQL4 and I would like to modify the stoploss of and existing order. If my trade go up I would like to modify my stoploss, it should be greather than the open price (in case of buy), in this case OrderModify return me error code 130. Does anyone have a solution to modify...
Hi Firstly, sorry for my bad English. Im trying to make my EA. But im a newbie MT4 code, so it's hard for me. Would you please help me? These are what im trying to to: - It works on many pairs same time - If the Buy (or Sell) condition is right, it will open 1 order per 1 bar (new bar new 1 order) -...
I used TimeCurrent() to get the current server time.. But when used it in the tester, TimeCurrent() becomes the time of the chart time at which the strategy tester is running.. I want a way to get the current time to appear on the tester.. (Tried to get the local time as well, it also equals to...
Hello I hope someone can help me find an "error" in this function. The Problem: I want to calculate the high of the last 31 daily candles if Line4CandleHL == false. The number of days is returned until the point where I put the Print(). If I move it below LineH, LineL the variable LineTFBars does...
Hi Does anybody know, how to find out the brokers Commission rate !!!before!!! a trade have been made on Metatrader 4 (not 5) ? Of course, I know that there is the OrderCommission() API function. But this only works, if there are already existing previous closed orders. However, if there are no...
Hi guys, glad to be apart of the family and looking forward to helping out where i can aswell as being helped haha In need of some help with my trouble. So as it stands, it reads this for example Open: 1.59270 High: 1.59320 Low: 1.59248 Close: 1.59251 Although now i would like to add a few things to...
Hi guys, is it possible to store a value inside a for-loop so that I can use this value for further calculations outside the for-loop?
How can I undo creating an object (HL, VL, Trendline) after pressing a button to create it? (not by calling ObjectCreate, so I do not have the object name) My current thoughts and questions: There is a menu "Charts->Objects->Delete Last", but it has no effect after a) I draw a HL and chose it or b)...
Hey guys, Here's my script below, mostly it works as per inputs, but sometimes there's difference in TP, SL, and Distance. I mean, is there a way to make it 'recheck' for inputs and trades for their TP, SL and distance? //+------------------------------------------------------------------+#property...
Hi everyone! I am new to making EA but not new to trading. I currently have an EA that buys when the price closes over my MA, with a 50pip TP and a 30pip SL, and vice versa. But my problem is that it opens positions EVERY TIME a candle closes in those conditions. Which can be very inconvenient. If...
Hello  I meet  problem with  indice of TimeHour() When the indice is a constant  like : int t = TimeHour(Time[2]);  Comment(t); TimeHour of indice 2 is properly displayed. -------------------------------------------------------------------------------------------------------------------------------+...
Hello, I have a problem with loading all the data from account history. The problem is, that Terminal doesn't shows all historical data, only from January 2017 and 2016 is archived. I thought it was broker's problem and I send them email and I received an answer: Unfortunately we do not store any...