MQL4 and MetaTrader 4 - page 415

This EA is based on the "Forex Gladiator" strategy which was available for free download from the author a couple of months ago. Here's the basic strategy, it's a counter-trend system: BUY- Close must be above both the long term and short term SMA's. Close must drop down within n-points...
Hi, I want to select the newest order. Following code is for searching all orders? How can I modify the code  to select the only one order (newest one) ? I want to select only the newest order to compare the price, etc.... How can I know the newest order information? I want to know OrderOpenPrice()...
I made an EA so that if the profit is above 0 the order is closed. But the order is still being closed even if the profit is negative. Why is this happening? OrderSelect(OrderA,SELECT_BY_TICKET);         Alert(OrderProfit());// It does alert a negative profit         if(OrderProfit() > 0)...
Hello. How know I closing ticket by stop loss?  or mql4 have any event about close ticket by stop loss ? I'm not good English, so I draw simple cartoon for your understanding. Thank you !
I have made an indicator that notifies of EMA in the M1 chart based on the status of MACD in a M15 chart. This doesn't work when I have contradicting timeframes within my indicator. e.g.        signalemabuffer[i]  = iMA(NULL, PERIOD_M1, SignalEMA,0,MODE_EMA,PRICE_OPEN,i);      mediaryemabuffer[i] =...
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...
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...
[Deleted]
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?
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 and