MQL4 and MetaTrader 4 - page 149

Hi guys I need advice on what to do with the magic number of my EA. When I start my EA I manually input the magic number that my EA will use, and when I use my EA to a different chart and input the magic number I add +1 to the magic number used on the first chart so the magic number that will be
Please forgive me, I'm relatively new to using the Strategy tester. I'm trying to test an EA I've written to implement a strategy on GBPCAD.  But when I click in the "Symbol" box on the Strategy Tester Settings, I get a drop down list of Symbols, and GBPCAD is not there.  I see no options for adding...
Hi all, I would need to double-test the entry condition in my EA. The condition is the same but I want to test its validity with a time delay. for example: if(OPEN_CONDITION){        time_delay (2s);        if(OPEN_CONDITION){                OrderSend();        }} Sleep() function does not suspend...
Hi all, done some research on the following, and have hit a wall. In MT4 this seems to be more difficult to do, compared to MT5. Maybe I'm not searching in the right corner of the forum or internet? Wouldn't be surprised if I missed stuff. Hope someone here can point me in the right direction for
Is this possible? If yes, how
Hi bros, I have Expert Advisor and want to sell it, on the other hand i want to protect source code too. EA can be place at Metatrader market or user can be download .ex4 code website which to be ready later. Monthly subscribers for example must be paid 1000 usd for to use it. But if the subscriber
Hello i'm searching for an EA that i just have a screenshot of it It just place two pending order with a trailing stop and other very interesting features So maybe someone can find it back or code it Thank You
[Deleted]
Hi, I'm trying to modify my take profit; I've set parameters to TAKE PROFIT after the TP is larger then the Order Open Price(). { double TP = MarketInfo(Symbol(),MODE_TICKVALUE); for(int b= OrdersTotal()-1; b>=0; b--) { if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES))
One of my scripts stopped working after the update to MT4 v4.00 Build 1353 (16 Dec 2021). This script relies on an accurate value returned by function TimeCurrent(). I conducted a test with the following script on an MT4 platform which uses timezone GMT+2h: #property strict void OnStart () {
[Deleted]
Hello,none of my Expert Advisors is not working.Everything was fine but suddenly none of them is working.What to do?
  Meta 4  (5)
Hoe many be change
hi, When I I reach if(currentProfit >= (profitTarget +tradeCosts)) First I want to remove all losses trades -its working with this code: double LossToClose = - 0.5 ; for ( int i = OrdersTotal () - 1 ; i >= 0 ; i--) //loop all the orders { OrderSelect (i, SELECT_BY_POS, MODE_TRADES); //select
Hi I've encountered error code 1 when I'm trying to modify an order. I've looked into the web and the error occurred because the value is the same with the previous order modify. So I set a condition if there's no change of value in stoploss than return. double trailingStop =
[Deleted]
A nice, complete queuing for you all - how do you delete your MQL4.com account
  Indicator MQL4  (5)
Hello dear community, i wrote the Indicator below and the Array "MA_MX" supposed to find the max price difference with MA and draw a line above it. However it sometimes gives me over 2Billion as the value and when i change the timeframe "sometimes" works seemingly ok. The problem is when it works ok
I have a list of symbols. Pairs = "EURUSD,GBPUSD,GBPUSD,USDCHF,USDJPY" ; I want to know how many times "USD" is repeated in this list. Pairs = "EUR USD ,GBP USD ,GBP USD , USD CHF, USD JPY" ; I want to know this for others as well, for example for "GBP" and "EUR"
  Modify RSI.mq4  (3)
Good day, I'm newbie in coding so struggIe to understand the RSI.mq4 file. Just want to put a small change, that mq4 file can calculate the data which - period 5 - use the result of RSI 14 It's like the option "Previous Indicator's Data" (when the previous indicator here is RSI14) but I dont know
Hi everyone, I encountered error code 138 when backtesting. I've looked on the internet that RefreshRates() can fix this. However after using it the problem still exist. Here's my code: if (newBar && !CheckIfOpenOrdersByMagicNumber(MagicNumber)) {
Dear forum members! Are you familiar with MT4 EAs that use entry and exit points? (Which predefines these, but only opens a position if the market moves that way.) Please write if you know of any
  Expression  (2)
what happens if I do this, x = y = z
<Deleted> a drag n drop approach to price alerts for MT4. <Deleted> <ex4 file deleted - post mq4 if you want to share>
Hey everyone, I'm fairly new to coding EA's and im just learning all of the workings of indicators and i've hit a roadblock with an indicator that i found and was tinkering with.. I was just hoping someone could point me in the right direction (been spinning my wheels for a couple days now). All i'm
Kedves Mesterek! Dear masters! My question is: Would it be possible for an EA to only trade (open positions) between 12 and 20 every weekday. BUT he would bring stop orders 24 hours a day (Buy stop, Sell stop). So you could only open them at that time. Do you think it can be solved? Thanks for your
[Deleted]
So is there any particular valid reason as to why my EA is doing the very opposite to what I have told it do to? Any valid reason as to why It's returning known OrderSelect() error messages when I have set my EA to ignore certain error codes. I know why the EA is retuning these error codes and is
Hi, I want to ask you how can I use and trades only one trade. I used ontick this code: switch (EA_ModeStrategy) { case Trade1: { UpdateComment= "TRADE1" ; Trade1(); } } I have selected Trade1 in my dropdownlist in expert settings and
[Deleted]
Hello I'm writing my first EA and it includes and SMA. If it crosses, I just want it to close the old order(if there is one) and open the new order in the right direction. I tested it and improved it, but the EA opens the new position and doesn't close the old one. Here my codes: The one to close...
does any one can help me to do  i have two array , array A & array B  if i want to save array A data to csv then read from csv and to write to array B how can i code it,thank you! that is my code blow  thank you!  "writefile"handle=FileOpen(filename,FILE_CSV|FILE_READ|FILE_WRITE);...
Half of candlesticks are missing on charts
  Supertrend -> Icustom  (16   1 2)
Hi I have read many threads about this, but i still can find a solution... I wanted to try this common and very popular indicator, the "supertrend"...but still not finding the right way... actually I'm in stall with this code... double val_super_trend_up = iCustom(NULL, 5, "SuperTrend_plus", 10, 3...