When a disconnection occurs when an EA tries to open an order.
Is there a way to ensure that it would place that last order once connection is established again?
(Regardless of the conditions that were set for the order to be opened in the first place.)
Supply Demand with Mean Reversion Concept
The concept of supply demand trading rely on the quantity mismatching between buying and selling volumes in financial markets. To typical traders, supply demand zone serves as the turning point. When we looked at its original concept, we have found that the original supply demand trading can be performed better at mean reversion period rather than trend period. For the demonstration of this concept, for any supply demand zone to work as an successful tr
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
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 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 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.
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
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.
Does not support hedging orders on a single symbol on MT5
MultiMTCopier MT5Receiver - 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 Advisor is designed for the MetaTrader 5 terminal, trades will be copied into this terminal.
The EA will copy all positions without delays Additionally integrated notification in situations requiring user attention
News Trader Pro is a unique robot that allows you to trade the news by your predefined strategy. It loads every piece of news from several popular Forex websites. You can choose any news and preset the strategy to trade it, and then News Trader Pro will trade that news by selected strategy automatically when the news comes.
News release gives opportunity to have pips since the price usually has big move at that time. Now, with this tool, trading news becomes easier, more flexible and more excit
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
This is an intelligent trend indicator based on Moving Averages and Bollinger Bands. The indicator does not redraw at all. In order to trade, all you have to do is watch for color changes. Go short when a thick red line is drawn over price action, and go long when the blue thick line appears under price action.
The indicator will show the trend, so therefore it is advisable that you must use an oscillator to provide for well-timed entries. Otherwise, the stop loss will probably be reached. Usin
The MultiTimeFramesAnalis indicator analyzes 19 time frames from M1 to D1. If there is a bullish candlestick, the rectangle is green, if there is a bearish candlestick, the rectangle is red, if there is a Dodji - the color is yellow. Furthermore, it calculates indicator values based on the current trend strength. This indicator can be used as an individual trading system. The input parameters are the binding coordinates of the indicator window to the left top corner of the main chart. You can at
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:
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
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
What is Squeeze?
A contraction of the Bollinger Bands inside the Keltner Channel reflects a market taking a break and consolidating, and is usually seen as a potential leading indicator of subsequent directional movement or large oscillation movement.
When Bollinger bands leave Keltner Channel it means markets switching from a low volatility to high volatility and high volatility are something all traders are looking for.
What I was missing in some indicators is possibility of monitoring many
This is a professional trading robot, which implements the classical strategy of trading inside a channel based on the PriceChannel indicator. The signal is formed at a breakthrough of the lower and upper borders of the Price Channel inside the channel. If the price breaks the lower border of the Price Channel and the price is fixed above this border, it is a buy signal. If the price breaks the upper border of the Price Channel and the price is fixed below this border, then it's a sell signal. O
The Triangular Arbitrage EA exploits inefficiencies between three related currency pairs, placing offsetting transactions which cancel each other for a net profit.
Easy to set up and supervise No indicators or hard analysis needed The strategy is time-frame independent Under ideal trading conditions, triangular arbitrage is a zero-risk strategy Arbitrage is a high-volume strategy and generates a lot of rebatesIt implements a set of unique features:
You decide which pair set
Ichimoku Kinko Hyo is a purpose-built trend trading charting system that has been successfully used in nearly every tradable market. It is unique in many ways, but its primary strength is its use of multiple data points to give the trader a deeper, more comprehensive view into price action. This deeper view, and the fact that Ichimoku is a very visual system, enables the trader to quickly discern and filter "at a glance" the low-probability trading setups from those of higher probability.
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!
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
This indicator is an adaptation of the MQL4 TDI writen by Dean Malone.
It uses RSI oscillator to assist traders to identify market conditions and reversals. Many strategies have been developed involving TDI or similar indicators which proves it's reliability and potential profitability.
Blue shadow and yellow market line can be removed from chart in the indicator options panel. A file with instructions is available upon request.
The Expert Advisor modifies the Stop Loss level of the opened position (on the current instrument).
The Parabolic SAR, NRTR (Nick Rypock Trailing Reverse), Moving Average indicators or the linear channel regression are used.
Trailing stop only when profit;Trailing stop only to price;work on each tick or on completed (formed) bars.
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
The Digitized Candle Length indicator calculates and shows the length of bars (pips) between High and Low, and also between Close and Open.
The upper digit is High/ Low, the lower one is Close/Open.
You no longer need dozens of monitors to analyze the behavior of 28 different instruments on 6 timeframes in statics and dynamics of their relationship.
Megatrend Monitor SF286 allows you to do all that on a single monitor in a window of a single chart.
Model SF286 only resembles its predecessor - Megatrend Monitor.
SF286 received a completely new algorithm based on the SinFractal 7TF indicator, and became much faster in calculations and histogram plotting.
And most importantly, SF286 acqui
Currency Power Meter shows the power of major currencies against each other. The indicator shows the relative strength of currency/pair at the current moment in a period of time (H4, daily, weekly, monthly). It is useful for day traders, swing traders and position traders with suitable period options.
Currency power is the true reason of market trend: The strongest currency against the weakest currency will combine into a most trending pair. As we know, trend makes money and all traders love t
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 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.
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.
Channel Flow with Strength Meter
Strategy: Increase probability by confirming signals with strength Watch Video: (Click Here)
Yes, absolutely! An EA should always be coded to be able to recover from a disconnect or even a PC Crash. It should be coded to store its state, and to pick up where it left off, such as a disconnection.
However, you should not just retry the order without reconsidering the new market state. Consider for example, that during the disconnected period, market conditions changed sufficiently that would no longer comply with your original signal criteria and once the connection was reestablished it would be a very bad idea to place the order.
So, I would suggest, that you code your EA, so that in the event of disconnects or crash, that it restart from a known base state and have it reevaluate market conditions and signals (and any open trades), and only then, if still valid, would it proceed with placing the order adjusting for new prices quotes (and/or also manage any open trades accordingly).
Lets say the strategy requires me to place that order regardless of the conditions
How to tell the EA to place that order it missed once connection resume.
I don't quite get what the exact nature of your difficulty is. Maybe you should show some code so that we can understand what it is that you are having trouble with.
Just monitor (and react to) the normal Checkup points, that you would normally verify during the EA runtime - errors (_LastError), connection (IsConnected), trade context (IsTradeContextBusy), etc.
In other words, you could use a simplistic state machine (or any other appropriate method), to keep track of what has to be done depending on what state the EA is in.
EDIT: Here is a good reference PDF that might help you understand that the difficulty you might be facing is not so much a coding issue, but a basic design (or human thought) issue:Computation and State Machines by Leslie Lamport (April 19th, 2008)However, if that is too mathematical for you, here are a few links to simpler explanations:http://whatis.techtarget.com/definition/state-machinehttp://blog.markshead.com/869/state-machines-computer-science/https://en.wikipedia.org/wiki/Finite-state_machine
EDIT: Here is a good reference PDF that might help you understand that the difficulty you might be facing is not so much a coding issue, but a basic design (or human thought) issue:
However, if that is too mathematical for you, here are a few links to simpler explanations:
int ticket=OrderSend(Symbol_1,OP_BUY,LongLot,ask,slippage,0,0,"My EA",12345,0,Green);
Print("BUY " ,Symbol_1 ," order opened : ",OrderOpenPrice());
else Print("Error opening BUY " ,Symbol_1 ," order : ",GetLastError());
I receive error 128 - Trade timeout.
if (int GetLastError() == 128)
int ticket=OrderSend(Symbol_1,OP_BUY,LongLot,ask,slippage,0,0,"My EA",12345,0,Green);
if (int GetLastError() == 128)int ticket=OrderSend(Symbol_1,OP_BUY,LongLot,ask,slippage,0,0,"My EA",12345,0,Green);
"ERR_TRADE_TIMEOUT" is not necessarily a disconnection. However, from your code, I see that it seems that maybe the concept of "state machines" or even "event driven architecture", may be a little beyond your knowledge and experience to be able to implement, so maybe you can just try something a little simpler - maybe you can just code a simple retry loop:
// Please note: Uncompiled and untested!!!
intRetryCount = 3, // Order Retry Count
intSleepTime = 100; // Retry Sleep Time
void someFunction( void )
int intOrderRetryCount = IsTesting() ? 0 : intRetryCount;
ResetLastError(); // Reset Error Codes
int intTicket = OrderSend(
_Symbol, intType, dblLots, dblOpenPrice,
intSlippagePoints, dblStopLossPrice, dblTakeProfitPrice, strComment,
intMagic, 0, intColour );
if( intTicket != EMPTY ) break;
// Test for various Error codes
switch( _LastError )
// Do something accordingly in this case
// Don't Retry and Exit Loop
intOrderRetryCount = 0;
// Do something accordingly in this case
// etc for all Error codes you wish to handle
// Do something accordingly in this case
if( intOrderRetryCount > 0 ) Sleep( intSleepTime );
while( intOrderRetryCount > 0 );