Download MetaTrader 5

MQL4 and MetaTrader 4 - page 181

To post a new topic, please log in or register
Hi all, I want to test a strategy that only works from 10-12 and it's very annyoing that I have to wait and watch the bars being printed from 0-10 although my EA doesn't work during these hours. Is there a possibilty to let the strategy tester start working from another time? 
{     if (DB_Profit>=DB_Target);DBFloor=DB_Target;DB_Target=DB_Target*DB_Target_Factor;   if (DB_Profit>=DB_Target);   else if (DB_Profit<DBFloor);  }   j=OrdersTotal()-1;   for (i=j;i>=0;i--)    {     OrderSelect(i,SELECT_BY_POS,MODE_TRADES);     RefreshRates();     if(OrderMagicNumber()==DB_Magic...
Hello,   I need to calculate EMA in excel for backtesting. The formula for MT4 help topics is: EMA = (CLOSE(i) * P) + (EMA(i - 1) * (100 - P))  Where: CLOSE(i) — the price of the current period closure; EMA(i-1) — Exponentially Moving Average of the previous period closure; P — the percentage of...
Hello    I need help to calculate Low of previous bar for multi symbol through one EA. I was using ilow() function. I did not get correct update low of previous bar. 
Dear Sir all , please answer my question   Is there an option in MT4 for automatic trade or if there any robot can do this? for example , when i want to open a deal automatically of 1 lot of EURUSD ( sell or buy) at time 08:00 am , this means that when time became 08:00 am, my deal must be open...
Hello, I have been trying to integrate my calculation on eurusd chart. However, I could not find where I am mistaken. Would you help me out with my codes at below ? Or what do you suggest to have result as a line on EURUSD chart ?    Thanks.    // The code is being used for educational purpose only...
No matter my EA uses iMA or iCustom indicators, the indicators are not displayed on the chart where my EA is running. But my EA exactly works with those indicators. It means indicators are working for the EA, but not displayed.    Do you know how to make the indicators displayed? Thanks. 
Hi, Is it possible to get an alert when any of the symbols in MT4 terminal crosses the 30 level RSI indicator and how?
  Add a Line on EURUSD (11   1 2)
Hello, I have been searching and reading documents to find a way how to draw a line on eurusd chart and the line , which I calculated by using other pairs prices, is the result of my calculation. Could anyone help me how to add this result on eurusd chart as a line ? Thanks.
I know what iHighest/iLowest do but have found that these are quite often hit by spikes in the price. Is there an easy way to ignore the highest and/or lowest and get the second or even third highest or lowest.
Hello all,   I've been developing and trading with systems based mostly on candlesticks. Because I am a programmer, I start coding a Metatrader4 program to help me. I believe it can help more people as the program is very configurable and extensible. Is is still under development and needs testing...
Currently, mql4 can only provide time down to the nearest second for incoming ticks. We use the following function: MarketInfo(Symbol(), MODE_TIME) 1) Is there a different function that can provide millisecond time stamp or can be used to determine milliseconds for tick data coming to the platform?...
Hello all, Facing a problem when coding my simple moving average EA in mql4, just lacking mql4 knowledge really. How do I make it stop the trade when going 30 pips below/above MA, this is to protect from bad trades or negative SMA as I call it (see image). I don't want to use a stop loss. Currently...
The problems noted at https://forum.mql4.com/68999 and https://forum.mql4.com/67275 are still the same - if not worse.  If this one isn't corrected, it will act as an incentive to users to open multiple mt4 accounts simply in order not to have to switch to different chart timeframes. 
I am having a custom indicator which accepts 3 extern variables as input (1)Signal_Type, (2)Entry_DateTime & (3)Entry_Price. With the help of these inputs indicator plots some objects on the chart as depicted in image below.   This custom indicator allows user to edit these extern variables in...
Hello, I need your help. What I want from the EA is that as the Margins arrive to a specific bottom it will stop adding new trades and stop executing. How to do it, Please.
Hi all, I am preparing an EA which uses Partial Close in its logic inside I can save remaining order after partial close with magic number control But now, I have different problem in OrderOpenTime, remaining orders ( generating after partial close ) have different OrderOpenTime() than original...
I am new to mql4 coding. This is my first indicator using arrays and I'm having problems with the object delete function, its not removing indicator after removing from the chart? I have looked everywhere for a solution I can't see how this is not working, does anyone know what needs changing below?...
I've noticed some codes Sleep at the start of a code then Refreshes to update values before continuing with the rest. Is it not better to Sleep at the end of the code? Then RefreshRates is not required? edit: should probably specify purpose: to make sure the code only runs once per second for...
Hi i m beginner so i have some question about EA programming. I want get value from indicator (MA20) and take it into my sql program ,but i dont know way to take its. Advise for me , Thank you   
Is there any standard function to get total closed orders for current day? eg: must count only closed orders count day by day! if there is no standard function available please give me a suggetion to get daily orders count?
Why doesn't the TimeCurrent function print millisecond precision or allow the user to specify whether they want millisecond precision?  It doesn't make sense that the mt4 terminal expert/journal real-time logs, backtest journal logs, and server ping functions have access to millisecond precision,...
/+------------------------------------------------------------------+ //|                                                     buyOrder.mq4 |//|                                                       David_kdcp |//|                                                  falavaspace.com...
Hi   I have an alert in my indicator when it triggers its giving me the message multiple times? Here is the code, I would just like the alert to send once please.    if (Time[0] >= TimeCurrent())      {         AlertStatus = true;         if (AlertStatus == true)...
Hi, am I right that we cannot have this kind of pointer structure? struct _S{ int i;};_S p, arr[];ArrayResize(arr,5);p = &arr[2]; // compiler error: '&' - operand expected  test_OrderArrray.mq4     Is there another way than using a function (that requires calls by reference)?
Good day, Please i want to know how objects (Buttons,labels,lines etc.) can be enable or made to work in strategy tester visual testing. There is a product in the market which uses the functionality and i want to know how its done. Tried asking the developer but he said its a secret. Here is the...
MarketInfo(Symbol(), MODE_POINT) will return gibberish when expert is compiled with '#property strict'? I just turned again into playing with mql and got into this issue. Anyone know anything about it?  [UPDATE] it appears the same when using Point property. This happens to me in strategy tester....
MarketInfo(Symbol(), MODE_POINT) will return gibberish when expert is compiled with '#property strict'? I just turned again into playing with mql and got into this issue. Anyone know anything about it?  [UPDATE] it appears the same when using Point property. This happens to me in strategy tester....
pretty new to programming.  i imagine this is a pretty common thing, so just wondering if anyone can save me the work. thx.