Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Views:
27559
Rating:
(34)
Published:
2015.12.11 11:08
\MQL4\Include\Common\
Common_Trade.mqh (33.27 KB) view
\MQL4\Include\Divergence\ \MQL4\Experts\
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

The Expert Advisor uses signals provided by the DivergenceViewer indicator. This does not require the indicator to be present in the terminal folder. The EA configuration parameters include the "Divergence parameters" block, which duplicates the similar parameters of the indicator.

The EA opens deals when a divergence of a specified class is registered. The Stop Loss level is set behind the local extremum, reached by the price over the divergence formation period, at the distance of "Offset for Stop Loss, pts.". The Take Profit level depends on the distance between the deal opening price and the Stop Loss level. This ratio can be adjusted using the "Ratio of the TP size to SL" parameter.

For the Expert Advisor to properly detect the divergences, it is necessary to specify the amount of bars, sufficient for the correct calculation of the base indicator values, in the "Start bars count" parameter. For example, to calculate the values of the William Blau base indicator with the parameters 8000, 1, 1, the chart is required to have at least 8000 bars.

The detailed description of the Expert Advisor and thorough test results are given in the article The Divergence Expert Advisor.

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/14277

iPulsar - indicator of critical price levels iPulsar - indicator of critical price levels

The indicator registers the price level breakout moments and the significance of these levels.

High, Low and Close of the previous day, week or month High, Low and Close of the previous day, week or month

The indicator shows the High, Close and Low of the previous day, week or month with time shift.

Close all locked orders Close all locked orders

The function closes all locked orders. This really saves money on the spread.

Lot-SL propotion Lot-SL propotion

The function returns the lot size, which is calculated based on the stop loss size and the risk specified in the variable.