I believe if I run an EA in an ecn account then market orders open in two stages:
1- The order is first opened and then only after that the2- the stop-loss and take profit are placed.
Most of the time this is not a problem but occassionally my stop loss order and take profit order are not placed so my position is left exposed with no stop loss.
Can anybody suggest a solution for this.
The indicator ColorCandlesDaily draw candles with different colors depending on the day of the week.
This Expert Advisor is version of MetaQuant-ATC10, modified for one currency pair, with the possibility to adjust and optimize all parameters.
Of course, can be attached to more/several currency pairs and get a result like in the Automated Trading Championship 2010.
The Expert Advisor is based on the "Averaging Grid". If the position is developing at a loss, open new orders in variable step. The aim is to approach the average price of a position to the market price, so the correction will turn
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 indicator calculates the quantum frequencies using the current market data. The quantum frequencies are used in Spectrum analysis of automated trading systems to create quantum filters for selecting signals, i.e. skipping trades that are likely to be unprofitable.
How It Works
It analyses the trade results of automated trading system for each frequency (512 frequencies are used). Calculation of the frequency response to search for "profitable" and "unprofitable" f
The strategy is based on the Alligator technical indicator, described by Bill Williams in "Trading Chaos".
The system is based on three moving averages (Lips, Teeth and Jaw lines), and oscillators, calculated using the difference between them. The trading signals are generated after crossover of the Alligator lines, depending on trend, determined by order of these lines. In the case of upward trend the Lips line (with minimal period) is the highest, the next is the Teeth line, and the lowest i
Script to Delete Pending Orders
Sometimes you placed many Pending Orders and then you want delete certain kind of these orders, this script can help you!
Download and drag and drop this script to the chart.Check "Allow AutoTrading" in "Common" tab and set input parameters in "Inputs" tab. Input Parameters:
TypeOfPending: which type Order you would delete. mySymbol: which Symbol you would delete. The input format of the Symbol is such as "EURUSD" or "eurusd".
Do you know how frequent the ticks beating? "Ticks Thermometer" can help you! It is useful to find out which symbol is more active.
Put it to each chart which you are watching. The color indicator from left to right corresponding green to red. Green block means "cool" since the tick is quiet, and red block means "hot" since the ticks is violent.
Quest UploadChart is an expert, it help you upload the chart image to ftp server.
input string Filename. Screenshot file name. Cannot exceed 63 characters. Screenshot files are placed in the directory \Files. The filename, you set a string, like myfile, do not add ".gif" as extension. If you let it empty, the expert will create a filename for you, the name is like this: ChartFileName=Symbol()+Period()+"chart.gif";input ushort ImageWidth=600; The chart image width, default value 600
Trade Channel Indicator DCMV
The DCMV Indicator calculates the following Channel characteristics:
Channel Bounds (for TP and SL). It's assumed that price will never go outside the channel.Center Line of the Channel.Settlement price (with probability 90% the price will return to this line).Reference line (used for detection of trend).Upper and Lower breakborder. Used for generation of trade signals: channel breakout (trend strategies), false breakouts (flat strategies).Usage:
The indicator pro
The AdvancedTrend indicator automatically traces market price movement and draws a pair of resistance and support lines.
It's easy to figure out market trend with resistance level and support level and when/how market breaks out key price level.
The Loading deposit allows to see the Margin/Deposit ratio for opened positions and provides a convenient way to control risk in trading.
The Margin/Deposit ratio is shown as a gradient color histogram, the color depends on Margin/Deposit ratio.
The values >50% indicates high risk and shown with red color.
Painting Deals on active chart. It allows analyzing trade history on an account to which you have an investor (read only) password.
Type of the arrow displayed indicated the deal type:
Right Arrow means In and In/Out deals Arrow Left Left means Out deals.Blue arrows are for Buy deals and Red arrows are for Sell deals.
The indicator displays deals in the real time mode, it also displays their Stop Loss and Take Profit levels.
Put the mouse over the arrows to see the details of deals includ
This indicator is used to distinguish between different trading hours.
By Asia, Europe and the Americas volatility, it has drawn with different colors.
The script illustrates the usage of the OBJPROP_XOFFSET and OBJPROP_YOFFSET properties. It displays the specified fragment of the .BMP image.
The script ObjChartSample.mql5 illustrates control of chart properties using the classes from the Standard Library.
This script allows users to obtain MACD and OHLC values for each bar on the current chart.
The information is saved as a CSV file allowing you to perform quantitative analysis using MACD.
Please specify MACD parameters you like. After exporting the report, the script tells you the path where the file is saved.
The script SphereSample.mq5 illustrates control of graphic objects using the classes from the Standard Library (Base class of objects array CArrayObj, CChartObjectText).
The ColorLine indicator shows the line of the price moving average on the chart. The line has diffrent colors (100 bars have the same color). The color settings of the line is changing every 5 ticks, there are 3 color schemes.
Indicator on History Deals (MACD)
From History Report you can't know the MACD's value and OHLC of each deal. This script help user get the MACD's value and OHLC on bars which deals happen. The datas save as CSV format file so you can quantitative analysis someone's trading.
Please input value of MACD's parameters you like. It tells you the path of data file when output is done.
The script allows to easily watch the date and time of several cities selected by the user from more than 30 important cities all over the world. It also shows GMT, Server time and Local time.
The cities on the screen are automatically sorted by the date and time. You can save your setting on the Inputs tab and use them in future.
Notice: Daylight saving time is not considered.
DCMV Trade Channel Oscillator
The indicator calculates the values of DCMV trade channel oscillator:
Trade channel width. The value of trade channel depends on the trend (it increases at start of the trend and has the maximum values at end of the trend). The value of trade channel decreases at flat movement. The lowest values of channel width indicates the high probability of the very strong price movement.
The +DC line shows the "bulls" power. The -DC line shows the "bears" power. Th
Chaikin's volatility indicator calculates the spread between the maximum and minimum prices. It judges the value of volatility basing on the amplitude between the maximum and the minimum. Unlike Average True Range, Chaikin's indicator doesn't take gaps into account.
According to Chaikin's interpretation, a growth of volume indicator in a relatively short space of time means that the prices approach their minimum (like when the securities are sold in panic), while a decrease of volatility in a l
Indicator to measure market activity and to show speed of price in pips/sec.
Have you been wondering, what is current speed of the market? I see the ticks jumping up and down, can I measure their speed?
All these questions can be answered by TickSpeed v1.0- good looking indicator with good configuration possibilities. It will show you directional movement speed in ticks per second or in time defined by you!
Good for scalpers, good for long term-traders. Good for beginners, good for pros. Thi
The script shows statistics of trades for the specified period.
For example, if you want to know the details of trades of the ATC2010 Winner (bobsley):
Login with his account using the investor (read-only) password (MetaTrader5); Open the chart of his trading symbol (EURUSD); Run this script on the chart; Specify 2010.10.1 in "date from", and the diagram will be shown.
The strategy is based on price crossover with Moving Average indicator, confirmed by ADX indicator.
The trade signals:
Buy:closing price of the last completed bar is higher than moving average, the moving average increases at the current and last completed bars.Sell:closing price of the last completed bar is lower than moving average, the moving average decreases at the current and last completed bars.To filter the false signal, it checks the trend power (ADX>ADXmin) and trend direction using
This Expert Advisor can place pending orders at 00 price level which symbol is on current chart.
Example: current price is 1.4138, then 00 Price(higher) is 1.4200, 00 Price(lower) is 1.4100;
The EA can place pending orders as below:
Buy Stop at 1.4200;Buy Limit at 1.4100;Sell Stop at 1.4100;Sell Limit at 1.4200;
You could select all/one of those 4 options.
Additional: It won't place orders if same direction and same 00 price postion already is there. It place order again after that position
The idea of the system is to indentify the reversal patterns using the calculation of the composite candle.
The reversal patterns is similar to the "Hammer" and "Hanging Man" patterns in Japanese candlestick analysis. But it uses the composite candle instead the single candle and doesn't need the small body of the composite candle to confirm the reversal.
Range - maximal number of bars, used in the calculation of the composite candle. Minimum - minimal size of th
This indicator is based on the Fractals.
It draws higher or lower points and Fibonacci levels.
It works on all currencies and timeframe charts.
Randomly place pending orders just for do some testing. All is random: random symbol, random lots, random order type, random stoploss and takeprofit...
Notice: It can't run on live(real) account.
The ColorBars Indicator paints bars with different colors depending on the volume changes. If the volume has increased, the color is green, overwise the color is red.
Yes, when the broker only offers "Market Execution", then you have to implement a two step order placement.
However, your placement of the stop-loss and the take-profit in the second step has to abide by the STOP-LEVEL rules. If you are placing the S/L or T/P too close to the STOP-LEVEL limits, and slippage occurs, then it is best to calculate your S/L and T/P based on the current market prices instead of the original opening price.
You should also have checks in place to detect when the S/L and T/P fail to update and to retry the operation with adjustments for current conditions. Alternatively, you can initially set wider stops and then after that, tighten them again so as not to leave your position initially unprotected.
Thanks for your help. I am a beginner when it comes to coding.
1. It is best to calculate your S/L and T/P based on the current market prices instead of the original opening price.
2. You should also have checks in place to detect when the S/L and T/P fail to update and to retry the operation with adjustments for current conditions.
I made a note to you on line 6 of the code below regarding your 2nd point.
Could you maybe show me in the code below how I might implement your suggestions. If it is not to complicated because I don't want to take too much of your time:)
Brian: Thanks for your help. I am a beginner when it comes to coding.
you maybe show me in the code below how I might implement your
suggestions. If it is not to complicated because I don't want to take
too much of your time:)
@Brian: Part of your code is for Pending Orders and the other for Market Orders! So the requirements of a two step process is not required for Pending Orders. Only Market Orders require a two-step process for "Market Execution".
However, before setting a Stop-Loss or a Take Profit you should always take into account the values of "MarketInfo( _Symbol, MODE_STOPLEVEL )" and "MarketInfo( _Symbol, MODE_FREEZELEVEL )".
Please read the documentation Requirements and Limitations in Making Trades, especially about STOP-LEVEL and FREEZE-LEVEL, conditions which
are set by your broker that affect the placement and minimum sizes for
Stop-Loss and Take-Profit.
@Alain: That is only possible with "Instant Execution" (or with Pending Orders). With "Market Execution" of Market Orders you CANNOT place the S/L and T/P at the same time as the Initial order placement. You HAVE to use a 2 step process.
And I am not just ARGUING for the sake of it, but because this I KNOW VERY WELL and it is common knowledge and many have discussed it here on the forum. Even in the Code Base, there are several implementations of the 2 setup process.
In the next two screen-shots, have a look at the execution "Type:" on your Order placement dialog box (non pending orders) and spot the differences in the S/L and T/P fields and the deviation/slippage as well.
PS! Screen-shots are old but still valid for this argument!
You really don't know what you are talking about.
2016.11.08 19:18:17.430 'XXXXXX': order was opened : #11987283 sell 0.01 EURUSD at 1.10248 sl: 1.10258 tp: 1.102372016.11.08 19:18:16.996 'XXXXXX': order sell market 0.01 EURUSD sl: 1.10258 tp: 1.10237
Forum on trading, automated trading systems and testing trading strategies
stop loss order not being placed
Alain Verleyen, 2016.11.08 12:06
Thank you Fernando and Alain for your suggestions.