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.
The script creates account summary report in a separate window.
The report can be created for all deals and on deals for selected financial instruments.
It is possible to specify a time interval of calculation and save report to htm-file.
The script creates account summary report in a separate window.
The report can be created for all deals and for deals of the selected financial instruments.
It is possible to specify a time interval of calculation and save report to htm-file.
Fast Copy MT5 allows 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
MT5 —> MT5 MT5 —> MT4 MT4 —> MT5 MT4 —> MT4
* For any interaction with the MT4, it is necessary to additionally install Fast Copy MT4
One tool for sending and receiving transactions: [master] > [slave] operation mode can be selected in
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
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
Exp COPYLOT CLIENT for MT5 is a copier for the МetaТrader 5 platform. It copies forex trades from any accounts. Including those from terminals МТ5 and МТ4.
Install the Expert Advisor in the terminal where you want to copy trades. Specify any text label name as pathRead, for example, "COPY". This should match the master terminal (to bind the two terminals). To copy trades, you need to install the free Master copier in the terminal from where you want to copy the trades: COPYLOT
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 generates early signals basing on ADX reading data combined with elements of price patterns.
Works on all symbols and timeframes.
The indicator does not redraw its signals. You see the same things on history and in real time.
For better visual perception signals are displayed as arrows (in order not to overload the chart).
The indicator is a complete analogues of the Trend Monitor indicator for MetaTrader 4
The best results are obtained when the indicator works o
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!
The Expert Advisor implements the classic "triangular arbitrage", which is successfully used by hedge funds.
"Triangular" arbitrage refers to a class of neutral-market strategies, in which the profit or loss of open positions does not depend on the direction of the market movement as a whole.
In order to take profit, the EA exploits a weak spot of market makers - it utilizes the difficulty of balancing cross rates of all currency pairs.
The advantages of the strategy are the following:
The Red Green Trade Signals indicator just gives you the direct signal to open and close your positions, just like traffic signals.
When the signal turns to red, the market goes to short position, while the signal turns to green, the market goes to long position.
This indicator also provides the precise time and price to open/close your positions with the 'buy' (green) and 'sell' (red) arrows. It's easy to use, and it's ready to go without any parameter to set.
This indicator is implemented b
The indicator draws a trend channel and adds Fibonacci levels (extension).
It is a part of Argo-Trix strategy's set. However, it can also work as an independent strategy (trading within a channel, side channel's breakdown or Fibonacci levels).
The indicator has plenty of settings that can be changed according to your strategy and trading style. For those who trade within a channel, the indicator displays inclined or inclined + side channels and defines the side channel's width in the terminal
Open interest (current) is the total volume of effective contracts (futures, options) for which there have been no calculations yet. In MetaTrader 5 an open interest is displayed as "Open Interest" in "Details" tab of the "Market Watch" window, but it is not available as an indicator. This product displays the open interest as a candle chart for all trading instruments for which it transmitted to MetaTrader 5.
Easy to use - it does not have any specific parameters. Color and le
We present you an effective software solution for arbitrage between brokers.
The Arbitrage on the market became widespread due to decentralization. There are many liquidity providers, whose quotes differ for various reasons. By tracking the dynamics of changes in the quotes of different brokers, it is possible to determine the delayed and leading brokers, thereby predicting the future prices of the delayed broker for a short time. Knowing these prices and using efficient built-in software filte
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
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 program also takes the news calendar into account: the robot does not enter the market in a 10-minute interval before and after a news rel
The indicator enhances the potential of standard fractals and allows you to identify, display and use them, calculating them for any odd length, i.e. 3,5,7,9 bars and so on.
The number of bars to be used is set in the 'Left fractal bars count' variable (by default set to 2). Its value determines the number of bars on one side, not including the central one, i.e. for a standard fractal of 5 bars it is equal to 2 (2 bars * 2 sides + 1 central bar = 5 bars for a fractal search and identification).
The PZ Day Trading indicator detects reversals in a zig-zag fashion, without repainting or backpainting. Based on breakouts of variable lengths, the indicator uses only price action to pick trades and reacts to the market very fast. The positional accuracy of its signals offers huge opportunity for profits, easily up to 80% winners.
Amazingly easy to tradeChart statistics will help you to optimize your tradingIt works on every single timeframe without fine tuningThe indicator analyzes its own q
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
Pipfinite creates unique, high quality and affordable trading tools.
Our tools may or may not work for you, so we strongly suggest to try the Demo Version for MT4 first. Please test the indicator prior to purchasing to determine if it works for you.
We want your good reviews, so hurry up and test it for free...we hope you will find it useful.
Energy Beam with Swing Control
Strategy: Confirm swing pullback signals Watch Video: (Click Here)Energy Beam with Trend Laser
This is an open interest indicator for MetaTrader 5. It fixes open interest value once per minute and writes it to the file (on your PC). The product works on any timeframe but only with exchange instruments.
Trade in the opposite directions with HedgeTerminalApi library!
HedgeTerminalApi is a program interface allowing you to use HedgeTerminal virtualization technologies in your robots and scripts. With HedgeTerminalApi, you are able to trade in the opposite directions when two or more trading algorithms occupy opposite positions on a single symbol. The library allows robots to track their positions even if these positions overlap entirely or partially. Moreover, with this library, you are able to
The EASIEST way to manage your risk for each trade!
Add the indicator to your chart, configure a risk percentage (of account equity) Enter the number of pips for your stop loss into the text entry field that appears on the chart The position size to take will automatically be updatedThe product features two modes - a compact mode which allows entry of stop loss pips and shows the resulting lot size based on the percent risk setting, as well as an expanded mode that also shows
The indicator bounds the price according to a cyclic wave dependency. Thus, all the crossing points, in which the movement is changed considering the indicator period, are the optimal ones. The crossing points can be used as the potential market reversal points. However, do not forget about the complex approach: the indicator signals require additional data to enter the market.
The indicator consists of the two parts – entry system displayed on the chart and currency power analyzer.
The analyzer can take on values from 0 to 3:
the higher the value, the stronger the currency; the smaller the value, the weaker the currency; average values of the indicator suggest that the currency is in flat.Recommendations on usage:
Buy if Trader Dream shows Buy signal and the analyzer shows the currency's strength (the value exceeds 2). Sell if Trader Dream shows Se
Robust median renko style indicator for creating custom charts resembling median renko, mean renko, turbo renko and better renko candles as well as vanilla renko with wicks plus PointO charts. This all in one package provides all of the signals needed by day traders, scalpers and even long term traders.
Indicator is an overlay on the main chart so it is possible to utilize one click trading and order manipulation directly on the custom charts. Visual order placement is also
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
This is a convenient tool for measuring the number of points between prices. It support magnetizing to OHLC prices. Calculates profit considering specified lot size and spread (optionally). It counts the number of bars between specified point and the time difference between them. Calculates the slope angle from the horizontal position. Unneeded parameters can be hidden. It does not occupy much space when inactive.
Once you add the indicator on the chart, Ruler caption will appear (according to
Here is the product, which truly reveals all the computing and graphical capabilities of the MetaTrader terminal.
The TrendNavigator indicator helps you take the most effective trading decisions, features stunning accuracy, unlimited graphical capabilities and highly developed notification service.
3D graphics 4 unique trend determining algorithms 5 types of notifications of trend change which appear as Buy and Sell signals Very high accuracy Shows local lows and highs Free notification
This is a classical trading strategy, which falls into the category of breakout systems. They form support and resistance levels, which temporarily limit further price movement. When the price breaks down the support level or breaks up the resistance level, there emerges a strong momentum in the breakout direction, which allows to make profit on strong price movements with moderate risk.
To create the strategy, we used historical data with the quality of history of 99.9%.
It uses filtration o
The script allows users to easily close positions if their profit/loss reaches or exceeds a value specified in pips.
Please set slippage value first. Sometimes some positions do not close due to high volatility of the market. Please set larger slippage or restart the script.
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.