Double Top Bottom EA

27 February 2019, 15:14
Jan Flodin
2
612

The main purpose of this blog is to describe and explain the input parameters of this product. Further below you will also find a list of known bugs and other shortcomings as well as a list of planned changes.


  • PANEL SETTINGS
    • Amount of visible signals in the panel - The signals (pending trades) will be shown in descending order, i.e. the newest signal first. The panel can be moved around on the chart by dragging it with the top list. It can also be minimized. If closing it with the x button the indicator will be unloaded from the chart as well. You can set the last (XX) signals in the indicator settings. Default is 20 but you can change it to for instance 30. The panel height will then increase and in some cases it might not fit on your chart. To disable to panel you must set the value to 0. When clicking on a row a new chart will be opened with the selected symbol and time frame. The opened chart will be opened with your chart template which you have defined in the indicator settings. A line between the extremums as well as the neckline will be drawn on the new chart.
    • Panel width - For instance, if you are using a non-standard font size in windows, you could set this to a larger value in order for the whole text to be visible.
    • Template name - The template you put here will be applied to the chart which will be opened when you click on an item in the panel. The name must include the file extension (.tpl). The purpose of this parameter is to make it easier for quick decision if to take the trade or not. Or if to wait for real reversal confirmation. Typically you would then use your own template which for instance could contain a support/resistance indicator.
    • Code page to use for extended unicode characters in symbol names - Here you have the the possibility to set a custom code page to support unicode extended characters (pound sign etc.) in symbol names. Usually the code page 1252 will do the trick.
  • GENERAL SETTINGS
    • Enable multi-mode trading - With this option enabled it is enough to put the EA on one chart and it will trade any symbol and time frame of your choice. Please see the SYMBOLS AND TIME FRAMES section below.
    • Send alert instead of opening trade - When set to 'true' an alert will be sent instead of opening a trade.
    • ECN account - Set to 'true' if you trading account is an ECN account.
    • Wait for candle close - If set to 'false' then the identification of a top/bottom formation will be done intracandle, as the conditions are fulfilled, without waiting for the candle to close. The trade on a neckline breakout will also be opened as soon as the price has crossed the neckline, without waiting for the candle to close.
    • Delete existing signals at parameter change - If set to 'true' then all pending trades will be delete when you change a parameter. This can make sense if you for instance enable the RSI and/or MA filter and already have pending trades based on these filters being disabled. Pleast note that when changing it to true after the EA was already loaded, the pending orders will not be deleted until the next time you will change a parameter.
  • TRADING FILTERS
    • Open buy order - Set to 'false' in order to disable long trades.
    • Open sell order - Set to 'false' in order to disable short trades.
    • Enable trade time filter (your broker's server time) - Time filter for opening trades.
    • Trading from/to time (hh:MM) - Hour and minutes from/to.
    • Maximum allowed slippage in points - Please note that not all brokers/account types support slippage control.
    • Maximum allowed spread in points (0=disabled) - Can be set to avoid taking trades with high spread directly after midnight market opening or at news releases. Useful for those with variable spreads.
  • TOP/BOTTOM (EXTREMUM) SETTINGS
    • Trade tops and/or bottoms - Drop down menu where you can select if to scan for only tops or only bottoms.
    • Trade double or triple top/bottom - Drop down menu where you can select if to scan for double or triple tops/bottoms.
    • Trade only at neckline breakout - If set to True then the EA will wait for a neckline breakout before  a trade will be opened.
    • Max bars to search for first extremum - Default is 200. Will search for the first extremum xx bars back in time. The higher the value the more system resources will be needed.
    • Min. amount of bars between extremums - Default is 30. The higher the value the stronger the setup.
    • Offset in points from first extremum - Default is 150. If you set this to for instance 100 then the extremums must be within 100 points from each other. The lower the time frame the lower this value should be.
    • Use offset only when above/below first extremum - If set to 'true' then the second extremum's candle high/low price must exceed the first extremum.
    • Max. wick size % for neckline cross candle (0=disabled) - Wick is also sometimes referred to as Tail. Can be used to trade only on very strong movements where the candle closes near to its high/low. The value could then bet set to for instance 15 which means that the candle's body must be at least 85%.This setting will not be used if the parameter 'Wait for candle close' has been set to 'false' since the trade in that case will be take intracandle, as soon as the price has crossed the neckline.
  • MONEY MANAGEMENT (levels are in points)
    • Risk in percentage (>0 = auto lot) - If set to 0 the Manual lots parameter value will be used. If set to > 0 then the EA will use money management if combined with a stop loss.
    • Point value for risk percentage - Default is 1. Should normally not be changed. Only in some rare cases where the broker has unconventional tick values for CFD:s a setting of 0.1 could be used.
    • Manual lots - Will be used if Risk above is set to 0.

It is important to understand the logic and functionality of the 3 following parameters. If something is not clear then please contact me by sending me a private message (PM) here on MQL5.

---------------------------------------------------------------

    • Max allowed balance drawdown % (100=disabled) - This function will prevent opening of new trades on other charts where the EA is running if your accumulated loss is less than xx%. If the 'Close orders' parameter (explained below) has been set to False then already opened orders on all charts will continue to run (including averaging orders. The averaging mechanism will also continue to open new order if necessary).
    • Orders with this Magic number (0=all) - Default value is 67. Please note that in my set files the Magic number is set to 67XXXX. With the default value the EA will only check open order where the Magic number starts with 67. So if you have other EAs running with open orders then they will not be taken into consideration.
    • Close orders - If set to True then all orders, where the magic number starts with the value you have set above, will be closed immediately when the Max allowed % has been reached.
-----------------------------------------------------------------
  • TRADE MANAGEMENT (levels are in points)
    • Type of stop-loss - Drop down menu with the following selections:
      • Fixed
      • At first extremum 
      • Half distance - The stop-loss will be set in the middle of the first extremum and the neckline.
    • Fixed stop-loss 
    • Take profit method - Drop down menu with the following selections:
      • Fixed
      • Full distance from neckline - will set take profit same amount of points according to the distance between the first extremum and the neckline.
      • Half distance from neckline - will set take profit same amount of points according to half the distance between the first extremum and the neckline.
      • Trailing stop
      • Risk/Reward (based on SL) - The value in the 'Risk/Reward ratio' parameter below must be set.
    • Fixed take profit
    • Trailing stop and Trailing step - Will trail the stop loss constantly with the distance you have set as soon as the trade is in profit. If the trailing step is set to 0 then the trailing stop will be adjusted each 3rd second. Else the trailing stop will be adjusted every time the price has moved the amount of points you have set in the 'Trailing step' parameter.
    • Risk/Reward ratio - You need to set the 'Take profit method' parameter to Risk/Reward in order for this value to have any effect. You need also to set “Type of stop-loss” to Fixed and a fixed stop loss value. A stop loss value of 200 points and a R/R ratio of 1.5 would mean that the take profit level would be automatically set to 300 points (200 * 1.5) when an order is opened.
    • Break-even (0=disabled)
    • Break-even trigger - The price has to reach this level (calculated from the opening price) in order for the stop-loss to be moved to break-even.
  • RSI FILTER SETTINGS
    • RSI filter method - Drop down menu where you can select if to apply the RSI filter on first, second or both extremums. When used then extremum candle(s) must close over/under the RSI levels below.
    • RSI overbought level
    • RSI oversold level
    • RSI Period
    • RSI apply to price - RSI level is calculated from this setting.
  • MOVING AVERAGE (MA) FILTER SETTINGS - This filter will be used for neckline breakout trading only and if the MA filter is enabled the price must be below the MA period you have set up in order for a short trade to be opened and vice versa.
    • Enable MA filter
    • MA period
    • MA shift
    • MA method
    • MA price type
    • Use signal time frame - If set to 'true' then the time frame of for which the trade has been taken will be used.
    • Fixed time frame (only used if set to False above)
  • SYMBOLS AND TIME FRAMES (only used in multi-mode)
    • Symbols to trade - Here you will put all symbols you would like to the EA to trade. Every symbol must be entered in the exact way as it is visible in the Market Watch window and separated with a comma, without spaces. By design in Metatrader 4 the amount of character in a text (string) parameter is limited to 255. You can put more characters in the Symbols parameter but when reading the value, Metatrader cuts at 255. 255 characters will allow for 36 symbols and 35 commas (,) if the symbol length is 6 characters. If you need more symbols you can always drag the indicator with the remaining symbols to another chart. To come around this limitation you can set the value in the 'Use symbols from Market Watch window instead' parameter below to true. By doing this the indicator will use the symbols visible in your Market Watch window instead.
    • Use symbols from Market Watch window instead - With this option set to true all visible symbols in your Market Watch window will be used instead of the symbols above.
    • Time frames - Set to 'true' for each time frame you would like to the EA to trade.
  • ALERTS (if alert instead of trade is enabled) - Set to 'true' for each alert type you would like to receive.
    • Sound file: If you would like to use another sound file than the default it must exist in the Sounds folder. For example: c:\program files (x86)\metatrader 4\sounds.
  • EA SETTINGS
    • Magic number - If having 'Multi mode' set to 'false' and using the EA on the same symbol on multiple charts (typically with different time frames), then it is important that the Magic number parameter has a different value. If not then trades on the same symbol will interfere with each other.
    • Order comment - Default is "TopBottom". To this comment will be added the time frame. For instance "TopBottom H1".


Known bugs

  • Nothing reported or known at the moment. 


Planned changes

  • No planned changes


Share it with friends: