I'm trying to add a 'Trade' / 'NoTrade' element to my EA. My plan was to have a list of dates on which I don't wan't my EA to run, so UK Bank Holidays and US Holidays that kind of thing. My plan was to have a list in an external file that would be referenced by my EA to compare the results of a Date check. So using
string Date = TimeToStr(TimeCurrent(),TIME_DATE);//"yyyy.mm.dd"
I could establish the days date then check it does/doesn't occur in an external txt file with the dates expressed in the same format,
if(Date=="Something in an external list file")TradeToday="Yes";
so 2014.01.01 no trading on New Years Day or
2014.12/31 no trading on New Years Eve etc
Please can anyone help on this or point me in the right direction.
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
My Money Manager like a risk controller, which places your trades with the exact volume that meets your desired stop loss risk.
It can also help you to preview your EP/SL/TP levels before placing an order by dragging these levels directly on a chart, and keep reporting about them during the position opening.
With this tool, you will feel more comfortable when deciding to open orders, as well as forecasting your profit/loss with your orders. Placing orders is a very precise and profe
The Synchronized Charts script allows comparing bars of different symbols or different periods of the same symbol.
Attach the script to a chart and move bars or change the scale, all opened chart will move synchronously with the current one. The bars on different charts aligned to the border according to their open time.
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 marke
The Trade Manager Pro EA is a MetaTrader Expert Advisor that performs position management for you avoiding human errors and enhancing your trading activity.
Amazingly easy to use Trade easily from the chart Trade with precise risk management, hassle free Capital preservation is top priority Let profits run without your attention Enjoy risk-free trades as soon as possible Automatic trailing stops for all opened trades Initial stop losses are placed as soon as trades are
VirtualTradePad - is a contol panel for working with orders in МetaТrader 5 : buy, sell, buystop, buylimit, sellstop, selllimit, close, delete, modify, tralling stop.
VirtualTradePad won 2nd prize in the "Best Control Panel in the MQL5 Language" Contest.
The panel consists of 5 tabs.
VirtualTradePad PositionsStyle VirtualTradePad Ordersstyle VirtualTradePad SignalsStyleDemo version of the panel - VirtualTradePad LiteProfit or Loss PadINFO PadYou can also try this panel for
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
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 indicator incorporates the volume to inform the market trend. A warning system (chart, SMS and e-mail) is incorporated for warning when a certain level is exceeded.
Developed by Marc Chaikin, Chaikin Money Flow (CMF) measures the amount of Money Flow Volume (MFV) over a specific period. Money Flow Volume forms the basis for the Accumulation Distribution Line. Instead of a cumulative total of Money Flow Volume, Chaikin Money Flow simply sums Money Flow Volume for a specific look-back
The iTicksChart allows you to create custom tick charts. It is suitable not only for trading but also for analysis of tick history. Each missed or ambiguous tick is fixed and displayed on the chart. Experts, indicators, graphical objects can be used for technical analysis.
Advantages and Features
runs and works at any open chart window (called "base chart" further on in this document); looks like a common chart after launching (see Screenshots); history quality is monitored - each missed o
This is a highly accurate, universal, multitimeframe instrument for traders following supply and demand levels.
Each chart candle is in fact a cluster – the smallest unit of market data on a price movement and a volume/effort put into this movement. The combination of these clusters (the chart itself), as well as different combinations of clusters on various timeframes provide sufficient data for analysis.
The indicator displays peak levels of activity formed by the maximum volume, tracks the
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
Scalper with Automatic Parameter Setting
Would you like to have an Expert Advisor that could automatically calculate trade parameters and adjust to the current market situation?
We present you our new development for the Forex market. This is a tick scalper for МТ4 and МТ5 - TickSniper.
Trading with it is fully automated. Forget continuous monitoring - this Expert Advisor trades independently. Its settings have been optimized over the course of testing on our real accounts.
A script for opening a grid of orders
If you need to quickly open several pending orders (Buy Limit, Sell Limit, Buy Stop, Sell Stop) on a certain distance from the current price, this script will do all the routine for you! Allow AutoTrading before running the script.
Run the script on a chart.
Language of messages displayed (EN, RU, DE, FR, ES) - language of the output messages (English, Russian, German, French, Spanish). Price for open - open price. If set to
The indicator shows buy and sell signals.
Timeframe - any, currency pair - any.
alertsMessage - enable/disable the message window. alertsSound - enable/disable sound. Arrow Type - select arrow type.There are three simple ways to filter the indicator signals:
Compare direction with the indicator from the older timeframe. Use standard MACD diagram. Use Parabolic indicator.Do not forget about money management and stop loss.
The most profitable trend traders are the ones who know how to recognize not only the market trend, but also the trading opportunities that arise once a trend has been established. The Pz Trend Trading indicator has been designed to profit has much as possible from trends taking place in the maket.
Established trends offer dozens of trading opportunities, but most trend trading indicators neglect them completely, and leave the trader completely uninformed about what the market is doing during a
FULL Automatic is a fully autonomous trading robot for MetaТrader 5 without configurable parameters.
It is designed 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 automatically. The robot does not open n
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 script help user record the value of Moving Average and OHLC at the moment once deals happen.
The datas save as .CSV format file so you can quantitative analysis someone's trading.
Please input value of MA's parameters you like. It tells you the path of data file when script is stopped.
Auto Trade Copier is designed to copy trades between multi MetaTrader 5 accounts/terminals with 100% accuracy.
With this tool, you can act as either a provider (source) or a receiver (destination). All trading actions will be copied from the provider to the receiver with no delay.
Note: Demo version for testing can be downloaded at: https://www.mql5.com/en/market/product/5006.
Followings are highlight features:
Switch between Provider or Receiver role within one tool.One provider can copy tr
This is a half scalping system that analyzes the market using a transmission function and price movement speed.
This Expert Advisor is intended for trading on EURUSD, however it can run on other currency pairs. Please use the M1 timeframe.
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 Adept shows good results on a forward period (or backward in my case). This ca
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
The indicator determines the inside bar and marks its High/Low. It is plotted based on the closed candles (does not redraw). The identified inside bar can be displayed on the smaller periods. You may set a higher period (to search for the inside bar) and analyze on a smaller one. Also you can see the levels for Mother bar.
Period to find Inside Bar — the period to search for the inside bar. If a specific period is set, the search will be performed in that period. Ty
Ermou Street rather than an expert or an indicator is a all-in-one trading assistant easing your trading sessions by providing signals and notifications. It's an assistant rather than a robot - "an assisted steering rather than an autopilot", and now, it autoadjusts itself to any instrument, any timeframe & any circumstance.
First, you should watch the video. Then here's some explanation:
By default, attaching Ermou Street to a chart, you’ll get:
A panel Signals: buy (default b
The indicator represents an additional chart window with a lower time frame where bars are combined into groups that are equivalent in time to main chart time frame. Bars are synchronized by the right hand side of the window, i.e. the time of the last bar in the main window corresponds to the time of the last bar group in the additional window. The maximum number of groups is 16; the maximum number of bars combined into groups in the additional window is 256. Limitations on the numbers are requi
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
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
The main purpose of the indicator is to detect and mark trade signals on the histogram of the Awesome Oscillator according to the strategies "Trading Chaos, second edition" and "New Trading Dimensions".
The indicator detects and marks the following trade signals:
"Two peaks" - Divergence. The signal "Second wise-man" - third consequent bar of the Awesome Oscillator after its color is changed. The histogram crosses the zero line. The signal "Saucer".The indicator includes a signal block th
The indicator has been designed for use on FORTS, but it can also work on other markets, at brokers broadcasting the required data.
A peculiarity of these data is that they cannot be requested from the broker's server as a section of history, but can only be obtained for the current moment.
The indicator periodically requests the broker, collects to a file and displays the following history from the stored file:
The weighted average price. The volume of buy orders. The volume of sel
The Sane Reversal indicator is one of the leading oscillators. The signals are generated early, unlike in other indicators which give the signal after the price goes far away in either direction. The indicator displays the price reversals using arrows with high accuracy. The arrows appear on the zero bar and do not flicker of disappear regardless of the market volatility, which allows to trade effectively with short stop losses:
the Buy signal - white arrow on the bar Low,the Sell signal - red
Here's one idea:
- create text file with one date in the line. Dates should be in format same as TimeToStr() creates
- in the init function read all the dates in the array (to avoid file operations each time you need dates)
- when bar changes, check if the date of the current bar is in the array
Here is example how to read dates from the file. Note that I put fixed size for the dates array (30-no special reason, just thought it would be enough for one year). You can make it dynamic by resizing array, but you'll need to add some code to do that:
int filehandle=FileOpen("Dates.txt", FILE_READ | FILE_TXT);
int i = 0;
dates[i] = FileReadString(filehandle);
Now you have string array where each element is date in string format. Loop through the array and check if current date of the bar is in the list.
thanks drazen64, thats a superb answer, array's are somewhat of a new thing for me, but I recognize I need it for this bit of the code.
Once the array is built how do I loop through the array? I was thinking that I would use the first candle of the day (Midnight GMT) to produce the days date, then an 'if' statement to say 'Trading=On' or else 'Trading=Off' as the result, but I guess using this method I'm not sure what would go in the brackets if( 'Date' is in the Array) Trading="On" else Trading="Off";
Am I going in the wrong direction with this?
If you are not familiar with arrays, then you should get a quick introduction to basic data types. Take a look at the MQL Book, specifically introduction section on Arrays.
You should check time on the start of each bar because you don't know when your EA started or restarted.
Something like this should work:
static datetime last_time = Time;
bool newbar = false;
if(Time != last_time)
newbar = true;
last_time = Time;
string currDate = TimeToStr(TimeCurrent(),TIME_DATE);//"yyyy.mm.dd"
if(newbar == true)
// This continues example from previous post where array is declared with 30 elements
for(int i=0; i<30; i++)
if(currDate == dates[i])
// current date is in list of dates we don't trade
Trading = false;
This code should go in OnTick() function of the EA.
Thanks again drazen64, really appreciate you taking the time to reply. I'm going to swat up on arrays and then hopefully I should be able to interpret what you've given me a little better.
I'm building an EA that supports a trading strategy that I've been both back testing and forward testing over the past year or so. From the testing I've done it appears not trading on the bank holidays and the Christmas period is beneficial, plus it does give some trading down time as well, so that's what I plan to be using the code to do. Just thought I'd give some background.
I will manually add the exclude dates to a txt file as the input to the EA.
I've finally reached the point where my EA is stable and doing what I want it to, I now plan to use the above code, but my requirements have slightly changed. The data stored in my external txt file will contain two columns a date/time as discussed before in the format yyyyy.mm.dd hh:mm and a "double" ie 12345
yyyyy.mm.dd hh:mm "12345"
yyyyy.mm.dd hh:mm "23456"
yyyyy.mm.dd hh:mm "34567"
When I exported my two columns from excel, it added the "speech marks", when this gets read into my EA will it create an array of [rows] and [columns]? - dates[i] = FileReadString(filehandle);
When I loop through it I'm looking for it to find the currDate in the first column and output the value in the second column, which will be assigned to the double "TargetPrice"
I have looked at the array section of the MQL book and I 'get' what an array is and how it can be used, but it is stretching the grey cells beyond that at the moment. Any help or advice would be appreciated.
Since you are exporting from Excel, you should do that in "CSV" format. It is also text file, but with delimiters between columns.
Reason for this is that MQL has mechanism for reading CSV files which can separate values in a row.
If you want to read file as you have it now, you have to write code that will separate column values.
Read documentation on FileOpen() and on functions FileReadDateTime(), FileReadInteger() and FileReadString().
Thanks again for responding, I appreciate there was quite a gap during my previous posts.
So I've saved my csv file so my input is no tab delimited, I have two columns one with a date, the other a double, therefore FileReadDateTime(), FileReadDouble() will be required.
FileOpen() will need to be used with FILE_CSV so can this bit of code:- int filehandle=FileOpen("Dates.txt", FILE_READ | FILE_CSV); still be used?
and presumably this bit needs expanding on to introduce the second column?
Once the data has been read in and the array created within the EA, what is the best way to check that it's been created correctly???
The code above is about reading in the file into an array, which commands should I be looking at to lookup the date and out put the second column to a global 'double'
Thanks again Drazen for your time and help.