MQL4 and MetaTrader 4 - page 83

To post a new topic, please log in or register
Hi, Can you someone clarify me whether MODE_MINLOT is always same as MODE_LOTSTEP for any broker I am using below to calculate average price for my open positions and it works fine. But I have little doubt whether I should use MODE_LOTSTEP TotalBuyOpenPrice =...
Hi there, I was wondering if it was possible to get a list of input parameters given to an EA or Indicator? Right now I'm logging my EA's settings to a new file automatically whenever it detects that I'm using different settings so that I can look back and see what I was using in the past.  However,...
Is there a way to save "profiles" where only the indicators are saved and you then can apply them to a new chart? Profiles or templates seem not to work because they save either the objects too or they save whole groups of charts (profiles).
Hello, I developed an EA for the DAX (ger30), it works perfectly in tests I have no error. But when I go into real OrderSend and OrderModifiy returns the error "invalid tp or sl", while I never had this error in test. So I just ask for your help after spending the long hours digging into my code and...
  RSI as an OHLC indicator ? (24   1 2 3)
Hi all, I looking for an indicator that represents the RSI as a candle, with Open/High/Low and Close values.  Googled it but no luck. I can code in MQL4. How can I store the OHLC values of an RSI throughout a period of time (H1, H4 etc) ? Your help would be really appreciated. Any sample code on how...
Goodmorning i made a code in javascript that if i visit this page from browser it open a position in binary.com. But if i made a webrequest from mt4, it doesn't work also if i get result 200 on webrequest and 4000 error of mt4. Some one can help me?    string params="";      char data[];      int...
Hi there, i have never coded before and have no idea where to start on creating this advisor. The EA is a custom indicator im using along with another rule i have to enter my trades. I want the advisor to enter a trade when the 5MA crosses over the 10MA and the RSI 10 (applied to median price HL/2)...
Hi, I'll keep this quick. I am a scalper and use MT4 through my broker (they don't use MT5, yet) and i am looking for one very specific program: something that can add a set amount of pips lets say 10 pips as an automatic stop loss when i open trade with the One-Click trading function. I have found...
It is possible to read (using code in mql4), on which timeframe indicator is visible, like it's showed in Indicator's parameters window?:
hello all, I have a question about an indicator issue. I try to create indicator from two others. I do that because of the limit of 8 buffers for one indictor. And to analyse, i need the history of the indictor, in history, i mean the line before the current bar. For that, in the final indictor, i...
I do not understand one thing. Since Meta Trader, Windows, Android and all scripts, strategies and Expert Advisors for MT4 are written in C ++ or C # or similar C language. So far, Android has not created the MQL compiler under MT4 yet? I mean no MQL Editor for Android. Besides, there is no...
Ola  I need EA to close all positions when it reaches xpips. I already found some, but it seems that in a market with a lot of volatility they do not work very well. I suspect that if you put slippage this problem must solve. If possible put him to keep trying to close the positions if the price...
I am currently working on EA in following:  if the last closed order is a loss position, and then the next order will be a reverse position. Ex: if the last closed order is a Sell position and it hit the SL or Close by Ea, then the next position will be a Buy Position only even it match other sell...
If I open a Buy signal with the code OrderSend(....), how can I launch a Sell order if (only if) the first order go in Stop Loss? Example: 1° Order Long --> 1.0100; TP 1.0150; SL 1.0080; if TP in taken --> end the EA, if SL is taken go Short with the 2° order at the close price of the 1° order (=...
Hi all, I am quite new to mql4. I have just created my first EA which takes signals to open trade when main Stochastic line crosses signal line in the extreme area - this is theory. It works fine visually with the H1 timeframe. However when I run it through EA code the signals come in totally...
  Maximum Loss (11   1 2)
if(TodayLastProf()>=-4){// do this}double TodayLastProf(){double sum;for(int k=0; k<OrdersHistoryTotal(); k++){if(OrderSelect(k,SELECT_BY_POS,MODE_HISTORY)){if(OrderSymbol()==_Symbol && OrderMagicNumber()==magic_number){if(TimeToStr(TimeCurrent(),TIME_DATE)==TimeToString(OrderCloseTime()...
my code didnt perform well. ex : if(normal logic... ){ if( !hasSentAlertOnce ){ Alert(" Alert " + Symbol() +" "+ Period()); hasSentAlertOnce= true; } }else { hasSentAlertOnce = false; } anything wrong in this code (bt didnt wrk :( alert over n over ) . still couldnt figure out
Hi All, obviuosly brokers do not offer to download years of data, so i used "History Center" of MT4 to download my data form Metaqoutes. But because my EA is time based and most brokers are using DLST, i am curious how time/price is shifted if you download and use the data lets say in summer or...
Hi,I have a questions... What function I must use for open an orden when the price reach a specific distance?  Thanks.
Hey Guys,How does the code have to look like, if I want to open a Buy-Order every Monday?if(DayOfWeek()==0 {// Place Buy Order} sorry im new to mql
Comments that do not relate to the "OnCalculate Problem for Convert Candlestick Indicator to EA", have been moved into this topic.
Hello  I thought that my monitor was dying but I've removed that variable. Horizontal lines appear to be different colors on my screen depending on where they are drawn. This happens if I move their location by scrolling / zooming or if I highlight and move them. This is quite irritating as I use...
Hi!  Thanks ! #property strict#include <stdlib.mqh>#include <Controls\Dialog.mqh>#include <Controls\Button.mqh>extern string sVisualSettings="<<=== Visualization Settings ===>>"; // <<=== Visualization Settings ===>>extern color BuyFontColor=clrWhite; //Buy Btn Font Colorextern color...
Hi. The problem is, when I set a pending order by my EA in strategy tester with magic number 1: OrderSend(Symbol(),OP_SELLSTOP,lot*n1,sell_price,0,sell_stop,NULL,"",1,NULL,Blue); And when the SELL trade get opened in specified price, it's magic number automatically would be 1. But in my real account...
Hello, I've got a problem. I created an EA which trades the data of a range bar EA. Everything is working fine when I have both of the EAs operating on my computer MT4 terminal. I basically open up a M1 chart and place the range bar EA on it. After that I open up the offline chart which was created...
Hi, I have 3-level-semaphore indicator. Refer the attached mq4 source file.  Sometimes when current signal appears, previous signal near to that current signal disappears automatically.   Can anyone please suggest any changes in code so that the signals shouldn't vanishes automatically?  
Hi, how are you. I have a problem with a code that, under certain conditions, must determine if it is favorable to open a purchase or sale position, but only send the notice. I try to put an Alert ("There is an opportunity to buy or sell according to the case"). But the alert appears every time the...
Hello, I want to close all positions at a defined time. E.g. at 23.00 I want to close all positions.  What code you recommend.
Previously on build 509 the GMX for the email alert works fine, but after the update to build 600, it doesn't work anymore. This is the setting I use for version 509: SMTP server: mail.gmx.com:587 SMTP login: email@gmx.com SMTP password: ***** From: email@gmx.com To: email@gmx.com now the error is...