• Overview
  • Reviews
  • Comments (6)
  • What's new

Demand And Supply Diagram MT4 EA

This Expert Advisor analyzes the volume scale, divides the volumes into components (supply and demand), plots a diagram of supply and demand, and trades according to this diagram.

Application of the supply and demand diagram as the main part of the trading strategy claims to be universal. However, not all trading instruments are fully subject to it. Nevertheless, the EA features a set of optional modes and contains several calibration variables, which can be used to achieve the most acceptable result.

The EA does not use pending orders and open positions using market orders only. Along with opening a position, the EA sets the stop loss and switches to position management - it performs the stop loss trailing and partial closure.

This EA is based on the indicator with the same name (Demand And Supply Diagram MT4) and performs all of its visualization functions.

The description of the input variables mostly matches those of the indicator. Therefore, only the variables related to trading, optional modes and calibration are listed below.


Order

  • EntryLot - trade volume; if set to zero, the trade volume is assigned automatically depending on the DepositPart value.
  • DepositPart - percentage of the deposit available for the EA to trade; a value of EntryLot set too high will also be adjusted automatically.
  • PartialClosePart - percentage of the open position volume for partial closure.


Optional modes

  • Average - diagram's midpoint: moving average or weighted average based on volume.
  • Deviation - diagram's amplitude: the maximum or standard deviation, or Hurst coefficient based deviation.
  • Signal - data set (supply and demand and/or total volume) to be used for generation of the trade signal.
  • Correlation - enable/disable the mode of checking the correlation between the trade signals of the current and the higher timeframes.
  • ExcessValidate - select the mode of tracking subsequent chains of signals, as a direction filter - by trend and/or against the trend;
  • ElasticityValidate - check the elasticity of supply/demand to the price, with selection of the position opening type - "limit" and/or "stop";
  • Hedging - enable/disable the mode of holding two opposite positions, if allowed by broker.
  • Trailing - trailing mode: bi-directional (floating), unidirectional (only in profit), or fixed.


Calibration variables

  • LowLevelValue - below this value the volume will be considered as low, in percent. Recommended calibration range is from 10 to 30, with step 1.
  • LowestLevelValue - below this value the volume will be considered as very low, in percent. Recommended calibration range is from 10 to LowLevelValue, with step 1. If set to zero, the variable is automatically set to LowLevelValue/2.
  • HighLevelValue - above this value the volume will be considered as high, in percent. If set to zero, the variable is automatically set to a "mirrored" value, which is equal to 100-LowLevelValue. In this case, it does not require calibration.
  • HighestLevelValue - above this value the volume will be considered as very high, in percent. If set to zero, the variable is automatically set to a "mirrored" value, which is equal to 100-LowestLevelValue. In this case, it does not require calibration.
  • DurationParts - the number of the diagram sectors along the time scale. This variable can be used for calibration. Recommended calibration range is from 0.5 to 2.5, with step 0.1.
  • StandardDeviations - multiplier for the standard deviation mode. Recommended calibration range is from 1.5 to 2.5, with step 0.1.
  • HurstExponent - the exponent for the Hurst coefficient based deviation. Recommended calibration range is from 0.4 to 0.6, with a step of 0.01.
  • PositionEntryAreaTicks - width of the position opening zone in ticks. Optimal value - not more than 2.

The diagram plotting algorithm implies a reduction in dependence on the quality of volume scale, but such dependence still remains - before buying, make sure you evaluate the efficiency of the EA on your broker's quotes.

The strategy is intended for medium-term trading - the optimal timeframe is H1 or higher.

No reviews
Version 2.5 2018.07.20
Added one more option to the Deviation input parameter - deviation based on Hurst coefficient.
Version 2.3 2018.03.14
Improved the algorithm for checking the elasticity in the TfShift mode.
The ED and ES signals are now accompanied by the messages «Close sell position» and «Close buy position» as an additional indication when closing the corresponding position partially or completely.
Version 2.2 2018.03.02
Fixed algorithm for checking correlation with an older timeframe.
Added algorithm for checking volatility to avoid signals in too narrow flat periods of the market.
Version 2.1 2018.02.13
The FillingValidate function has been replaced by a more advanced ElasticityValidate function, which checks the elasticity of supply/demand to the price.
Version 1.9 2018.01.10
Improved the algorithm of the FillingValidate function.
The functions ExcessValidate and Direction have been merged into ExcessValidate.
Fixed the error in calculation of the daily chart length for symbols with additional shortened trading day.