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 indicator displays a market profile of any duration in any place on the chart. Any number of profiles can be set within one open chart. Simply create a rectangle of required length on the chart and this rectangle will be automatically filled by the profile. Change the size of the rectangle or move it - the profile will automatically follow the changes.
The indicator works on every timeframe available in the terminal, but, depending on the current period, it uses the hist
The trade strategy is based on three moving averages. To determine the trend, it uses three exponentially smoothed moving averages: FastEMA, MediumEMA and SlowEMA.
Buy signal: FastEMA>MediumEMA>SlowEMA (upward trend).Sell signal: FastEMA<MediumEMA<SlowEMA (downward trend).Input parameters:
Inp_Signal_ThreeEMA_FastPeriod = 8;Inp_Signal_ThreeEMA_MediumPeriod = 38;Inp_Signal_ThreeEMA_SlowPeriod = 48;Inp_Signal_ThreeEMA_StopLoss = 400;Inp_Signal_ThreeEMA_TakeProfit = 900;Inp_Money
The Expert Advisor implements the classic "triangular arbitrage", which is successfully used by hedge funds.
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 combining cross rates of individual currency pairs.
The advantages of the strategy are the following:
FourAverage: A Breakthrough in Trend Identification
With evolving information technology and increasing number of market participants, financial markets get less and less analyzable using good old indicators. Common technical analysis tools, such as Moving Average or Stochastic alone, are not capable of identifying the trend direction or reversal.
Can a single indicator show the right direction of the future price, without changing its parameters over 14 years' history, while at the same time
Purpose and functions of the indicator
The indicator determines and marks the moments of trend change on a chart based on the theory of fractal levels breakdown on any time frames. If a breakdown based on all rules is real, the horizontal lines will appear on the chart with corresponding color. If there is an up trend, the line will be blue. In the descending trend the line will be red. The blue line is a strong support level, the trader should look for buying opportunities above this line. The
Cluster analysis is now available in MetaTrader 5!
YuСlusters indicator builds a cluster graph based on tick data. For exchange instruments it is the volume and the last deal price, for Forex instruments it is the real or tick volume (depends on broker) and selectable type of the current price: Bid, Ask or (Bid+Ask)/2.
There are 5 criteria of cluster generation: Time interval, the criterion is set in seconds. Price range, the criterion is set in points. The current cluster is closed when the
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.
PipTick VSA is based on the original Volume Spread Analysis method. It was designed for quick and easy recognition of VSA patterns. Even though this indicator looks very simple, it is the most sophisticated tool that we've ever made. PipTick VSA indicator is a really powerful analytical tool that generates very reliable trading signals. Because it is very user friendly and understandable, it is suitable for every type of trader, regardless of his experience.
What is VSA?
VSA - Volume Spread An
This is an utility for automatic scaling of a chart and making at least 140 bars visible in it. This is necessary for a correct wave analysis according to the Bill Williams' strategy "Trading Chaos". The utility can be used on any timeframe available in МetaТrader 5.
It draws a vertical line through the first bar the calculation starts from. This line allows you to see the probable starting point of the wave sequence along with a sufficient number of bars displayed in the chart. It also makes t
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!
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
SafeZone is a method for setting stops on the basis of recent volatility, outside the level of market noise. It is described in "Come into my Trading Room" book.
In a downtrend, SafeZone defines noise as the portion of the current bar that extends above the high of the previous bar, against the downtrend. It averages the noise level over a period of time and multiplies it by a trader-selected factor.
For short trades, it adds the average noise level, multiplied by a factor, to the latest hig
qAutoActivation indicator is one of the main components of Trading Chaos Expert trading expert panel. The indicator displays the current trend on the current timeframe. This is the first indicator that is attached to the chart and saved in the trading complex template. It defines what trading signals from the expert panel should be automated for market entry (bullish or bearish ones).
When the trend changes, the indicator changes the line color and, at the same time, highlights the trading pane
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 main purpose of the indicator is to determine and mark trade signals on the histogram of the Accelerator Oscillator, which were described by Bill Williams in his book "New Trading Dimensions". The list of signals:
The buy signal when the indicator histogram is below the zero line. The sell signal when the indicator histogram is below the zero line.The sell signal when the indicator histogram is above the zero line. The buy signal when the indicator histogram is above the zero line. The
The Expert Advisor places pending orders above the high fractal and below the low fractal on the distance of "The point of creating order". When one of the orders triggers, the second is removed. Depending on the parameter "The number of orders in the series" the Expert Advisor works in two ways:
"The number of orders in the series" = 1
It is a breakthrough Expert Advisor. If the fractal broken through upwards, buy with fixed TakeProfit and StopLoss. If the fractal is br
The indicator has standard settings. The new modification of indicator provides special marking of the segment when the moving averages begin to form a cross in one direction or another. The Alligator`s cross indicates that the trend is about to change. Modified Alligator helps traders to determine a trend on a particular timeframe even if the averages are intertwined and have a shift in the future. Direction of a trend is determined by a cross of the averages with a specified marking area on th
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
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.
Trend Laser with Volt Impulse
Strategy: Confirm impulsive signals Watch Video: (Click Here)Trend Laser with Energy Beam
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
VirtualTradePad is a panel for managing main orders in МetaТrader 5: Buy, Sell, Buy Stop, Buy Limit, Sell Stop, Sell Limit, Close, Delete, Modify, Trailing Stop.
This version is for informational purposes. Analyzing the main trade strategies using 10 indicators and 8 timeframes, the panel draws signal direction.
This pane is a part of the VirtualTradePad series that took 2-nd place in the Best Graphic Panel.
A free of charge demo version - VirtualTradePad Lite.
х - no s
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
Trading Chaos Expert Lite is a light version of Trading Chaos Expert. In the Lite version it is not possible to receive the table of trading signals, automatically place pending orders based on them and maintain open positions for multiple symbols at the same time in one window. Only the Current Chart mode is available. In all other features the panel is fully consistent with the basic version of the Expert Advisor.
This is, rather, a well thought out trader's assistant which is not easy to do
TTMM – "Time To Make Money" – Time When Traders Makes Money on the Stock Exchanges
The ТТММ trade sessions indicator displays the following information:
Trade sessions: American, European, Asian and Pacific. (Note: Sessions are displayed on the previous five days and the current day only. The number of days may change depending on the holidays - they are not displayed in the terminals. The sessions are also not displayed on Saturday and Sunday).
The main trading hours of
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
The indicator calculates the actual status of your position on FORTS market. Since your position is re-calculated after each clearing on FORTS and other futures markets, you can see the status of your position on the chart and in the "Profit" section only starting from the last re-opening (clearing). The indicator solves this issue by displaying the level of the very first deal opening, the actual profit, swaps, and commissions. The product is most useful for mid-term and long-term deals on FORT
Does not support hedging orders on a single symbol on MT5
MultiMTCopier MT5Source - new and improved multi-terminal positions copier for your real / demo account, works faster, requires less, flexible in managing and upgrading, new information support. This expert is designed for terminal MetaTrader5 from which the position will be copied.
The EA will copy all positions without delays Additionally integrated notification in situations requiring user attention Buttons for re
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
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.
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
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.