MQL4 and MetaTrader 4 - page 279

Hi all, I m totally new to EA, and I just copy the code from website but i didnt know how to add in the stop lost for my open order.. Here is the code looks like input int SmallSMA= 20 ; input int BigSMA= 50 ; void OnTick () { // We create a string variable for the signal string signal = "" ;
Hello, Does anyone know the exact sequence of orderexecution from the time it’s placed by the trader (via OrderSend()) to the time it gets executedon the trade server? My current understanding is that once any order(pending or market) is placed by the trader on MT4 client, it gets passed tothe MT4...
Hello, I'm not a MQL4 expert but i was trying to develope the following idea. I would want to creat an EA which could get the number of parameters and buffers(outputs) from a custom indicator , so i can use that information to implement it on the iCustom() function. This will be use to backtest
{ StopLoss = NormalizeDouble ((Bid - ( 15 *pipstotrade* Point ())), SymbolInfoInteger (CurrentSymbol, SYMBOL_DIGITS )); TakeProfit = NormalizeDouble ((Bid + ( 30 *pipstotrade* Point ())), SymbolInfoInteger (CurrentSymbol, SYMBOL_DIGITS )); trade.PositionOpen(CurrentSymbol, ORDER_TYPE_BUY , lotsize
I have started an EA that will place either BUY or SELL orders based on certain criteria. This EA will run on multiple charts at the same time and will place orders in many different symbols. When a certain condition appears (say price closing below the 11 EMA), I want to close all BUY orders for
  StopOut EA  (3)
//+------------------------------------------------------------------+ //| Stopper.mq4 | //| Copyright 2020, MetaQuotes Software Corp. | //| https://www.mql5.com |
In the past this code did not throw errors I understand the return value and wondered what changed to cause errors where none existed prior ? Can anyone see fault with my highlighted solution code below. It's not throwing errors but is there a flaw in doing this ? Old code commented and highlighted
I'm looking for an indicator, I'm not sure if it already exists, so I'm coming here to ask first. Basically it's just the total amount of pips from green candles and the total amount of pips from red candles within the given period. An example would be, a week of bullish movement on EURUSD , you
Hi, I want to get the indicator data from a separate window. I need to do it in universal way. I mean, doesn't matter if it is an RSI window or MACD or anything else. I want to collect the indicator data into an array, regardless of what indicator it is (in other words: i need to get the data
Hello Goodnight. I am writing an indicator, and I want to register, and keep it fixed on the screen, the price that was at the moment the circumstances occurred: in this case, the Bid of the moment in which the averages were crossed. Can someone guide me? What function I should be used? Thank you
Hi, I read about the new mql4(Build 600+) and already updated my EAs, now i have a question. How secure is the new protection against crackers and other types of executable cracking and modifying the code. EX: hex editing date of expiration, memory dumps, etc.. How secure is a simple time
  Close all orders for Symbol  (14   1 2)
Sorry for my English I was using this function to close all opened orders for one symbol  if profit > xxx but the problem it close some of orders then the profit be <xxx and it stop closing other orders //--------------------------------- bool CloseDeleteAll(){    int total  =...
[Deleted]
Hey there! When coding for someone... Do you sell just the ex4 file, or do you give away the mql4 too? Do you ask extra for the mql4 file? Asking those feeling comfortable answering this 😉 Cheers
[Deleted]
  Writing to the file on a new line  (63   1 2 3 4 5 6 7)
Help me figure out how to write to a file . Here's the function: if (DayOfWeek()==day){ //Print("Woking . . ."); ac= Symbol (); ss1 = ac+day+ ";" +TimeToStr( TimeCurrent (),TIME_MINUTES)+ ";" +DoubleToStr(AccountBalance(), 1 )+ ";" +DoubleToStr(AccountEquity(), 1 )+ "\n" ; WriteFile (path, ss1);
Hello folks, I came across this old thread https://www.mql5.com/en/code/7673 that allowed creating offline charts for non-standard timeframes. It was built for v509 and hasn't been updated for a long time. Is there a current version that builds offline charts in visual testing mode for standard
Hello These codes consist of two keys, the first key closes half of the first open trade and the second key closes completely. The keys work in the demo account but do not work in the real account. Please help me, What's problem?! void OnTick () { ButtonCreate( 0 , "closeHalf" , 0 , 10 , 350
It is giving me some Invalid LotSize 4051, any ideas why and what could I correct? I want to calculate the distance from one signal until the other one. Lets say the signals are very good but 'who is without a flaw'? Then, I want to calculate the lotsize for a Martingale if the 1st signal goes wrong
  Mt4 not working  (1)
Every time it said no connection
Hi 1. I have 2 charts, chart one is a EA for example MyEA.ex4 whis is working good, on chart 2 I would like to disable MyEA.ex4 and after a while enable ! Is this possible ?! - OR - 2. I have 2 charts, chart one is a EA for example MyEA.ex4, how to programm that only chart 1 is closing (removing)
Hi all! I need to put comments on the chart my EA is running on. The idea is to place them in the lower right corner, so that I can visualize them better. How do I put them there? Is it essential to create a text object to do it? Or can it be done with a comment
Hi, Is there a way to know when the stop button pressed in the tester for an indicator? I've found details how to do so in an EA but I can't seem to find the right search parameters/details in the manual to find out how to do so with an indicator. I just need to run a function when stop is
In my EA I open 2 orders at once.  Order #1 : set TakeProfit value ( TakeProfit value calculated based on ATR of the time of order placed ) Order #2 : do not set TakeProfit value at the opening Later on I want to run trailing stop for the "Order #2" and I need to pass the TakeProfit value I used in...
Hi All, I like to use MQL4 to shutdown metatrader at specific time. ( for example: shutdown MT4 at UTC 10 pm or 10 pm brokers time) I dont like to kill the MT4 process (via windows batch), in order to ensure, that all terminal closing procedures will be processed correctly. Can somebody please give
  Advanced links/threads/tools  (30   1 2 3)
One more average and variations - key thread for MT4 One more average and variations for MT5 -  the indicators for MT5 are inside this MT5 thread  The following indicators can be found on the above mentioned threads: One more average - very advanced indicators with speed changing, with smooth...
[Deleted]
Hello everyone, I know this topic was discussed many times. But all articles I found on that topic were unfortunately too complicated or produce error message because they are too old. Therefore I wasn't able to create a script that does a simple POST/GET request. So, I simply want to send POST and
  TRIX Indicator for MT4  (34   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!
I have an Indicator that displays some information panes on the Chart window and one of them is at the right top side of the chart. The problem is that when someone will attach an expert to this Chart, the Expert name and its smiley are appearing right there. So, I need one of this two options: 1....
Hi everyone, I ran into quite a perplexing problem today. There are many symbols that I cannot select or get information from in my EA. In fact, it seems as if there's a bug within MQL4 itself. The following EA provides different results when ran in the debugger vs a strategy tester (both using the
Why the balance number of activation got reduced from 6 to 5 when i updated to 9.18? Its on Same MT Terminal, Same User, Same PC. Any response from Moderators on this Technical issue? <Deleted>
Currently I am planning to Manual Trade With this Indicator Rules, but I have some problems to be solved.. I need Help from this Forum. I hope This Indicator also helping The others to trade. Rules - Arrows and Alert Showing When The Price Crossing The Gold band IF possible, The Arrows and Alert