An interesting discussion guys but I still do not think this should be happening. I put the same code in an indicator and indeed the first value was always wrong then with subsequent 'ticks' the correct value was displayed.
The MT4 platform is notorious for its' poor data history compared to the brokers' customised trading platform. I can understand if you first opened a new MT4 platform you need to load history data to ensure you can make certain calculations and the traditional way of doing this is hold down the 'HOME' key on each timeframe until all data is loaded for M1 to MN1.
This should mean at this stage that the 'history' database for each timeframe is loaded. My concern is that the function MqlRates should store all data for all timeframes since we can ask it for any value at any time. This clearly is not the case....consistently anyway.
Also how sure can we be that if we are running an EA/Indicator on a particular timeframe but regularly asking for data values from other timeframes, that we are getting the correct values? What if you used the first value given (i.e on the first tick) for further calculations?
I know good coding says we need to check for successful completion like for OrderSend(), OrderSelect() etc; but how do we do this for simple in-built functions like iHigh()?
If we had to do this every time for these types of functions the programmes would be millions of lines long!
The script is intended for automatic placing of Buy Stop pending orders, Stop Losses and Take Profits on the user specified levels.
Avoiding unwanted entering a long position in case of false hitting the level as a result of widening of the spread by a dealing center. Avoiding unwanted triggering of a Stop Loss in case a quote pierces a significant level (fractal) without further confirmation with the close price. Setting a necessary virtual order and entering the market in
The script is intended for automatic placing of Sell Stop pending orders, Stop Losses and Take Profits on the user specified levels. This script is not that useful as "Virtual pending buy stop", since short positions are opened as Bid price crosses the levels. Thus spread widening is not dangerous. Nevertheless, you need to have this script to prevent unwanted hitting of the Stop Loss levels.
Automation of the process of placing the Sell Stop pending orders, Stop Losses and T
Cluster analysis of volumes is now available in MetaTrader 5!
The YuСlusters indicator is a professional tool for analyzing the trading volumes. The cluster graph is plotted based on tick data. For the exchange financial instruments these are the volume, type and price of a deal. For the Forex instruments - the real or tick volume (depending on the broker) and Bid price.
There are 6 criteria of cluster generation:
Time interval, the criterion is set in seconds. Price range, the criteri
This is the Famous Timing Indicator
You can now use the most famous Timing indicator on the planet.
Millionaire Mostafa Belkhayate earned his reputation by using this specific indicator to validate the entry signals supplied by his also famous Center of Gravity indicator on the Forex market. I spent hours, days, weeks to decrypt the formula and now it is finally available to you.
New and Unique for MetaTrader 5
Timing will give you perfect validations for your entry signals. It is the first
This is a half scalping system that analyzes the market using a transmission function. The system can be scalping or not depending on the "takeprofit" and "stoploss" parameters.
This Expert Advisor is intended for trading on EURUSD, however it can work on other currency pairs. You should use timeframe M1 for trading.
You should optimize only two parameters: Seconds_to_move and TradePrice. It is sufficient to optimize Bobra Adept only once, for example, for a half year period. After that, Bobra
The Expert Advisor for increasing (or opening) market positions.
Allows specifying the desired risk, target and searching for the best open price and trade volume.
It is included in the ActivePanel product.
The indicator is intended for determining the spread and swap size, the distance for setting stop orders and stop losses from the current price allowed and the risk per 1 point in the deposit currency.
The indicator informs a trader about possible additional expenses and profits connected with transferring a position to the next trade session of the financial instrument. It also informs about the spread size and the distance of pending orders, stop loss and trailing from the current price. In a
Envelopes or channel lines are set parallel to the Moving Average (to the slow MA if you use two MAs). The two channel lines must contain approximately 95% of all prices for the past two or three months on a daily chart, with only the extremes protruding outside. Channel lines provide attractive profit targets - sell longs near the upper line and cover shorts near the lower line.
The AutoEnvelope is a custom indicator - an original tool that automatically selects channels width by calculating a
FULL Automatic is a fully autonomous trading robot for MetaТrader 5 without configurable parameters.
It is similar to SAFE Automatic robot intended for traders having no knowledge of trading basics. It works in Low, Medium, High and Extremal trading modes.
The EA applies modified versions of well-known strategies, including Elliott waves, following a trend, half-pyramiding, scalping, speculative trading with a double deposit protection. The EA switches the strategies automati
This indicator has been created by a former hedge-fund employee and it automatically identifies when a divergence occurs between price and an oscillator. It can identify both bull and bear divergence and it is pre-loaded with four of the most popular oscillators. You can choose from RSI, MACD, Stochastics and CCI.
Remember: When a divergence occurs, it means that price and momentum are not in agreement. And divergence signals are widely used by institutional traders to identify potential revers
This Indicator is a unique, high quality and affordable trading tool because we have incorporated a number of proprietary features and a new formula. With only ONE chart you can read Currency Strength for 28 Forex pairs! Imagine how your trading will improve because you are able to pinpoint the exact trigger point of a new trend or scalping opportunity?
USER MANUAL: click here
Arrows in sub-window to show strong currency momentum GAP will guide your trading! Warning signs
Veno EA MT5 is a safe and fully automated medium-term trading robot.
The EA does NOT use hedging, martingale, grid strategies, arbitrage, etc.
Veno Expert System MT5 automatically monitors the appearance of participants with distinct preference towards buying or selling on the market. Trades are conducted on sharp cluster and news based movements of the market. The robot analyzes the market volumes and volatility, and follows strong supply and demand movements. It smoothly sets breakeven level
The indicator shows a line of a relative trend based on an oscillator selected from the list. The line can be used for support/resistance depending on where the price is. Direction (fall/rise) changes when the oscillator crosses the specified levels (it is equal to the middle of the range by default, the value is adjustable) and can be additionally displayed in a different color. Change in the direction of the secondary smoothed price trend is displayed as arrows (you can also enable alerts); it
FXG_Info – the most important data in one place.
MetaTrader 5 Indicator FXG_Info provides basic statistical information about a particular currency pair. So that in combination with a chart representing currency price it is easy to determine whether the current situation is good for trading. And when you open a position it will clearly show you the current data such as SL, TP, RR. You are not limited to currency. You can use any market which is provided by you broker.
The following information
Murray's levels are the most popular support and resistance levels among professional traders. With them, you can easily determine where the price is consolidating and where there is a breakdown of this consolidation. 13 levels have a special role in the price passage. Before you start trading with the help of Murray's levels, be sure to read what these works are based on.
NumBars - number of bars for calculation of the levels (default value - 64, professionals use 200) BackBars
Three variables are available for every strategy, any one of them can be disabled, their period can be changed.
type_order=ORDER_FILLING _FOK - order filling type.
ReverseTrade=false — trades opens in reverse direction if true. ExitOnBar=true — trades close on each bar only. spreadcover=false — Spread you pay includes in profit trades. It's like trade with zero spread but you should remember that it can decrease exact match between tester's result and live one. It
Easy Order is an Expert Advisor allowing you to enter any type of trade with one click based on your RISK preferences.
You can choose to enter a trade and automatically calculate your lot size based on how much of your account you want to risk. Risk is calculated based on your Stop Loss placement. You can use a fixed lot size if you don't want to use risk based calculation of lot size. Your previous setting of risk based or fixed lot size remains saved for your next use of this Expert Advi
This software has no equals in the world and represents a universal trade "console" covering trading signals, automated market entry, setting of Stop Loss and Take Profit, as well as Trailing Profit for multiple trades at the same time in a single open window. Intuitive control of the Expert Advisor in "three clicks" ensures a comprehensive use of all its functions on different computers, including tablets PCs.
Interacting with additional signal indicators that mark the chart to give a real mar
The fractal analysis of the markets is used in the indicator operation algorithm. According to the fractals theory, after the breakthrough of the fractal level confirmed by the closing price located below or above the fractal, the trend wave in the direction of the breakthrough starts to develop. Until the fractal has been passed in the opposite direction, the trend is considered to be acting even if the price is flat or moves backwards. If a bullish fractal has been previously broken through on
PZ Lopez Impulse indicator evaluates volatility and price directionality simultaneously. It is an extremely easy to use indicator.
The blue histogram represents the bullish impulse The red histogram represents the bearish impulse The gray histogram represents the current volatility The moving average is the average volatilityThe trading implications are straightforward.
You can buy when the bullish impulse exceeds the average volatility (blue histogram > moving average) You can sell wh
Active Lines - a powerful professional tool for operations with lines on charts. Active Lines provides a wide range of actions for events when the price crosses lines. For example: notify, open/modify/close a position, place/remove pending orders. With Active Lines you can assign several tasks to one line, for each of which you can set individual trigger conditions, as well as conditions for re-activations and the number of possible activations.
Active Lines helps you easily organize various tr
Fast Copy MT5 allows you to copy trades between different MetaTrader 5 (netting)(hedge) and MetaTrader 4 accounts in any direction and amount, quickly and easily (without loading the system).
Any type of copying is available
MT4 → MT5 MT4 → MT4 MT5 → MT5 MT5 → MT4
* For the MetaTrader 4 terminal — Fast Copy MT4
* For the MetaTrader 5 terminal — Fast Copy MT5
** Before the purchase, you can test the program by downloading the free demo versions — Fast
Safe Automatic is a safe MetaТrader 5 trading robot working autonomously on a VPS server. The good results are achieved on EURUSD.
The EA applies modified versions of a trend-following strategy, half-pyramiding, scalping, Elliott Wave method and speculating trading with a deposit protection. The EA switches the strategies automatically. The robot does not trade at night from 10 p.m. to 4 a.m. (server time).
The robot was tested in the special tester on real ticks. Empirical e
Auto Trade Driver is an automatic powerful tool (run as Expert Advisor) that helps you to manage risk and control orders and maximize your profit in multi-protect/trailing-stop rules.
This tool is very useful for both scalpers and trend followers. It not only calculates the trade risk exactly, but also protects and maximizes your profits in real-time.
With this tool, the only thing you have to do is to enter trade by your own strategy, then it will auto-drive your position with exit strategy y
The economic calendar is made in the form of an Expert Advisor that downloads the data from one of the most popular Forex sites (forexfactory.com/calendar.php). The data is presented in two ways. The first (primary) is represented as icons with detailed information about the event. The second is displayed as a line with a news description. Economic Calendar downloads published news in real mode with the possibility to adjust the spacing of data validation and user-friendly customizable graphical
The OandaX product series is designed to display additional data on orders and positions provided by the Oanda FxLabs service.
The OandaX Download Manager EA is included in the OandaX product series and is designed to download data for all OandaX indicators running in the terminal.
To test your trading strategies and for historical data analysis, you can use free OandaX 5 Download Manager BETA. It is similar to Download Manager but provides data with a delay for a day.
Note. The EA uses WebRe
This trading panel has been developed for fast and comfortable operation of the financial markets. It is equipped with the necessary functions for manual and semi-automated trading. Due to the presence of the order trailing feature, trailing stop and automatic closure by equity, profit, time. You can use it to automate your trading system. All you have to do is open a position and set the parameters for maintenance, everything else will be handled by the EA. If you want to limit your losses, set
This indicator is based on Moving Average but it's optimized through Price Regression Prediction algorithm.
This indicator allows you to enjoy the two most popular products for analyzing request volumes and market deals at a favorable price:
Actual Depth of Market Chart Actual Tick Footprint Volume ChartThis product combines the power of both indicators and is provided as a single file.
The functionality of Actual COMBO Depth of Market AND Tick Volume Chart is fully identical to the original indicators. You will enjoy the power of these two products combined into the single super-indicator!
Range Bars for MetaTrader 5 is a unique tool for conducting technical analysis directly on the charts, as the indicator is an overlay on the main chart. This also enables the trader to place and modify orders directly on the range bar chart (even with the use of one click trading)
Apart from range candles, the indicator also includes the most commonly used technical studies which are 2 moving averages, that can be customized according to the user's needs.
Several channel types can also be disp
Opening another chart and scrolling to the beginning ensures longer history only (the script alone will not load more than 2048 last bars for other timeframes).
I do not consider a problem checking consistency of data for a programmer. But there are additional problems involved:
- brokers have inconsistent primary data often
- loading the chart leaves large gaps in the history occasionally
- accessing other timeframe allocates additional buffers with the entire chart history (a copy of the original history), for every single script (i.e. you can easily hit memory limits)
the problem here, with checking successful completion, is that the wrong value of e.g. iHigh, can be anything, and not only zero, so there is no easy way to check for
Luckily there are some workarounds ; all I can find ATM, is to force a single ChartSetSymbolPeriod() inside on OnInit(), as follows
#property copyright " "
#property link " "
#property version " "
iHigh(NULL,PERIOD_M30,0); iHigh(NULL,PERIOD_MN1,0); /* examples of TFs */
ChartSetSymbolPeriod(0,NULL,0); singleton=1; /* if someday program hangs, we may put singleton=1 first */
int singleton; /* a global variable - if #property strict is used, it has to be int singleton=0; */
/* so , TFs will be available now, on first call of e.g. OnTimer */
After all , a remark is MQL is supporting nameless functions (the headless block which contains iHigh calls above)
edit: the nameless block is eye candy only :)
edit 2 . Ok, once more, what i wrote is somehow useless :) there is no need for ChartSetSymbolPeriod(), as the effect is that the time passed between OnInit and OnTimer is enough for the asked prices (from iHigh) to be downloaded; so what someone needs is maybe have a Sleep() inside OnInit as to be more probable that the download will be finished by the time OnTimer or OnTick will be called
edit 3 . In Timeseries and Indicators Access/CopyRates we can read "If requested timeseries are not yet built or they need to be downloaded from the server, the function will immediately return -1". So maybe here is a clue as to how be certain if the history is present or not in our computers Or maybe RefreshRates
I still find the fact that we have to wait for the inadequate Mt4 platform to download history data unacceptable. I originally used ArrayCopyRates() in very my small programme and this did not show -1 (fail) but did still give the wrong data values!
Anyway, we are still discussing an even simpler programme which just uses iHigh(). For me whichever way you look at it if I use an in-built function like iHigh() I expect it to give correct results - loading databases is not rocket science - all other custom broker platforms (i.e FXCM's Trading Station) do not have this problem.
I know there are gaps in the history sometimes and you can physically see these on the chart - if I can physically see that the most recent bar (bar zero) is on the chart then I should be able to interrogate the statistics of that bar using iHigh(), iLow() etc. - for me this is very simple but very frightening that something so simple is so inconsistent.
There are many traps in MQL4 programmes but this should not be one of them!