MQL4 and MetaTrader 4 - page 27

To post a new topic, please log in or register
Hi Guys I am trying to write code to find divergence for long and short on MACD indicator. But, I don't know where to start ... I am new with all this. Can someone help please. Thanks a lot. V.
Hi I am a novice in MQL4 How can I select the last order opened ( in terms of orderopentime() ) when there are multiple orders opened. Any help will be much appreciated. Thanks Hamid
what is the function for (buy/sell) same pair multiple time  means buy eurusd lot 0.01 ten times at same time
Hi, I'm trying have an open order close, but i get an error saying "invalid lots number for OrderClose function." The same happens for the ticket, "invalid ticket number", unless i save the order as a variable. I imagine there's something obvious that I'm missing and would really appreciate any help...
Hi - what's the best possibility to trade based on levels given in a spreadsheet with the following information; Pair, Trade direction, Entry level, Stop loss level, Distance to current price from entry level (based on Google Finance, could possibly make the EA read the current MT4 market price...
Hi Looking for assistance with EA.  I am new to MQL4 code and have done what i can but can't work out what i have missed or done wrong. Orders are opening as they should and closing at expiration time.   Orders are not deleting on activation of opposite order and order modify for stop is not working...
I want to move the EA comment from left to right corner ? Ask for advice as well. Get help
  TRIX Indicator for MT4 (32   1 2 3 4)
TRiX (3 Exponential) indicator for MetaTrader 4. The TRIX is a trend-following indicator used by triple smoothing of price and looking for anomalies and rate of change. How To Use TRIX How To Use TRIX Download here: Click here to download Great trading!
The following is the code: if(distance<MarketInfo(Symbol(),MODE_STOPLEVEL)+5)distance=MarketInfo(Symbol(),MODE_STOPLEVEL)+5;if(CheckMoneyForTrade(Symbol(),startposition,OP_BUY)==true&&IsNewOrderAllowed()==true)     {     if(open=!OrderSend(Symbol(),OP_BUYSTOP,NormalizeDouble(startposition,2)...
I want to make each day open, the ad is loops (Hedging style) The values ​​used to open orders on a daily basis are not equal, they are the values ​​of the day. Some days to order to go to another day. For example: Makes the next order opening time in the first day's loops take the value of...
  How to return new SL (12   1 2)
Hello! In an EA, I modify the SL and then I want to return the new stop loss as the following: current_SL = OrderStopLoss(); But I got the original SL (before modification) into the current_SL How can return the new OrderStopLoss() into the current_SL Thanks. PS: I defined the current_SL as double...
Hello, I am pretty new to mt4 and have limited understanding of what is possible code-wise, so if I ask about some impossible stuffs then simply say "no can do.". 1/ Would it be possible to color tabs in mt4  based on a simple yes/no condition ? ( the tabs I mean currency listing letters that are...
Hi LTF was 60m and then it changed to rubbish value: https://i.imgur.com/bqt4Vjj.png Also when I copy all to excel, some values are corrupted: How to fix it? https://i.imgur.com/1Q9vcBQ.png
  Why does this not work? :( (23   1 2 3)
void OnTick()  {   datetime candletime=0;   datetime currenttime=0;   currenttime=Time[0];   double K_line=iStochastic(NULL,0,20,3,5,2,0,MODE_MAIN,1);   double D_line=iStochastic(NULL,0,20,3,5,2,0,MODE_SIGNAL,1);   double pK_line=iStochastic(NULL,0,20,3,5,2,0,MODE_MAIN,2);   double...
<I would like to test from the Candle which is assigned randomly.> 1. However when I open the HISTORY from the TOOL of FX, it shows like below, ASKING : ***IS THERE ANY METHOD TO SEE THIS LETTER TO BE CORRECT LETTERS? (ANSI and UTF-8 is same result. Do I need to download any letters?) 2. If you tell...
Hello, I place an Order, but I get the Wrong Order open time. Can someone tell me, where the error is? My code: if( OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,(Bid-0.0003),NULL,0,0,Red))               {               Print("SELL order opened : ",OrderOpenTime());               delTimeOpen( cnt...
Hello, according to the documentation (https://docs.mql4.com/constants/io_constants/messbconstants) "The main flags of the MessageBox() function define contents and behavior of the dialog window. This value can be a combination of the following flag groups:" But when I try this: int PlaceTrade =...
Hi folks, how are you? I have a question, can I import external charts to analyze in mt4 platform?
I do not know how the candling system in MT4 works. I am under the assumption that they are "japanese" candle sticks. They Have Open, High, Low, Close But They Are discontinuous. Like This:   Even on something like a 5M graph... Why Is This? This Makes Absolutely No Sense To Me. I am Assuming That a...
Hello, All the sudden my windows computer doesn't know how open MetaTrader. When I click a link in the market, I get a box asking me to select how to open mql4buy. Does anyone know how to set the correct association, so that it will work again? Thanks in advance. All the best, Fred Langemark
Help me I'm writing code. Create a button to close all orders and Close only Profit order  Button  close all button is working but  close only profit not working. void OnChartEvent(const int id,                   const long &lparam,                   const double &dparam,                   const...
I create an Appdialog from #include <Controls/Dialog.mqh> and I need to use Run function to run my app dialog on Strategy Tester mode. How can I do that? Where should I put myAppDialog.Run();  to run my appdialog on Tester mode?
Hello, I have the following code... maxLots = AccountFreeMargin() / MarketInfo(Symbol(),MODE_MARGINREQUIRED);lotStep = MarketInfo(Symbol(), MODE_LOTSTEP);maxLots = floor(((maxLots / lotStep) * lotStep) * 100) / 100;maxLots = NormalizeDouble(maxLots, 2); With $1,000 in Free Margin on an account with...
Hi all, Newbie in forex. What does the volume indicator in MT4 mean? I saw something like 4, 20, 100 etc. Does it mean a full 100,000 units contract? For instance, 4 volume EUR/USD means 400,000 units of EUR? Thanks in advance. Hydrom
I'm very new to scripting in Mql4, but I want to make a script that takes the alert message from my indicator and sets multiple orders with the same stop and different take-profits But I keep getting a 129 error and I can't figure out why. Here is the string from my indicator GBPUSD BUY: 4.32 @ 1...
Hi, MT4- How can I have my Indicator analyze "X" # of candles before starting? If I dont do that, it may take many days/week before my EA has enough data to start dealing. Thanks
I have somehow managed to shrink the toolbar to just the left side of the page... how do I correct this so that the toolbar fills all the way across the terminal landscape wise?
Hi, Can any one please advise on my coding where I am wrong, basically I want to check 10 next candles after 2 moving averages cross but I am not able to run the counter loop. Please find attached my coding. Many thanks. Aryan
Hi I wrote this code after reading online, not sure how to do the "JPY" part of the code, please help and correct me if there is something wrong with it. Thanks // PIP value for standard lot 100,000 unitsdouble getPipValue(){  string symbol = Symbol();  int usd = StringFind(symbol, "USD");  int jpy...
HI all of you In about last two weeks i´ve discovered the power of MetaEditor . Ive heared about tons of expert advicors and mostly all of them are profitable ( ! hope so :P ! ). During these two weeks ive been trying to code my own expert advisor but i´ve realized that im not able to understand...