Watch how to download trading robots for free
Find us on Facebook!
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
Experts

ExpPinBar - Expert Advisor for Pin Bar Price Action patterns - expert for MetaTrader 5

Views:
2698
Rating:
(7)
Published:
ExpPinBar.mq5 (93.63 KB) view
\MQL5\Indicators\PriceAction\
iPinBars.mq5 (17.27 KB) view
\MQL5\Include\Trailings\
Trailings.mqh (107.4 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

ExpPinBar Expert Advisor implements a trading strategy based on the Price Action PinBar indicator. Positions are opened based on signals from the indicator. To manage open positions, an extended trailing functionality provided by the trailing library is available: classic, by Parabolic SAR indicator, moving averages AMA, DEMA, FRAMA, MA, TEMA, VIDYA, as well as by the levels of High and Low candlestick shadows.

Settings for the pin-bar indicator:

  • Minimum size of a candle from low to high - Minimum size ofa candle (in pips).
    Sets the minimum allowed height of a candle being analysed (the difference between High and Low). Candles of smaller size are ignored by the indicator, which allows excluding insignificant or "noise" candles.
    Increase the value to filter weak signals on low-volatility markets;

  • Maximum size of the candle body relative to its shadows - Maximum size of the candle body (relative to the size of the whole candle, from 0 to 1).
    Defines the maximum allowable size of the candle body (difference between Open and Close) relative to the full height of the candle. The smaller the value, the more pronounced will be the signals with long shadows and a small body - classic Pin Bars.
    To find the most "clean" Pin Bars, use values 0.2 - 0.4;

  • Position of the body relative to the previous candle (from 0 to 1).
    The parameter defines how deep the Pin Bar body can go into the range of the previous candle. The smaller the value, the closer the body will be to the edge of the range, which corresponds to classic reversal patterns.
    Use values 0.2-0.4 to search for signals where the Pin Bar body is located near the border of the previous candle;

  • Aspect ratio of the shadows (coefficient)
    Sets the minimum ratio between the length of the main shadow (upper for Pin Bar for Sell, lower for Pin Bar for Buy) and the opposite shadow. The higher the value, the more pronounced should be the main shadow compared to the opposite shadow.
    Values 1.5 - 2.5 allow filtering signals, leaving only candles with a pronounced long shadow.

Advisor settings:

  • Position volume - Position volume;
  • Slippage (in points) - maximum allowable price deviation during execution, set in points;
  • Magic number -magic number;
  • Stop loss (in points), 0 - none, -1 - by PinBar shadow - Stop loss (in points), 0 - none, -1 - by PinBar shadow price;
  • Take profit (in points), 0 - none - Take profit (in points), 0 - none;
  • Stop loss deviation (in points) - Stop lossdeviation from the Pin Bar shadow in points.

Trails settings:

  • Trailing type - Trailing type
  • Trailingstart - Profit in points for trailing start
  • Trailingstep in points - Trailing step in points of price
  • Trailing offset in points - Trailing offset from price in points
Settings of indicators used in trails:
  • Indicator's timeframe - Timeframe of the indicator used in trawl calculation.
  • MA Period - Moving Average Calculation Period
  • MA Shift - Horizontal shift of the moving average.
  • AMA Fast EMA Period - Period of calculation of fast EMA adaptive moving average.
  • AMA Slow EMA Period - Period of calculation of slow EMA of adaptive moving average
  • VIDYA CMO Period - CMO period of moving average with dynamic averaging period.
  • ParabolicSAR Step - Parabolic SAR Step
  • Parabolic SARMax - Maximum of Parabolic SAR
  • MA Applied Price - Price for moving average calculation
  • MA Smoothing Method - Type of moving average smoothing.
  • Indicator data index - Bar of data received from the indicator

The iPinBars indicator and the library of trailing classes are required for the Expert Advisor to work.

An example of the work of the Expert Advisor for the last year on EURUSD H4 with fixed stop levels and using a simple trawl:



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

Simple Expert Advisor based on WPR, Bollinger Bands and ATR indicators Simple Expert Advisor based on WPR, Bollinger Bands and ATR indicators

A simple strategy based on the signals of two indicators: Williams' Percent Range (WPR) and Bollinger Bands (BB). A position is opened only when the signals of both indicators coincide.

Bollinger Bands Squeeze Bollinger Bands Squeeze

It signals a period of low market volatility that is about to end, foreshadowing a significant price move.

ATR without iATR() with smoothing Wilder by William210.mq5 ATR without iATR() with smoothing Wilder by William210.mq5

The goal is to show a code that shows the calculation of the ATR with Wilder smoothing

Wave Weis Bar Force Wave Weis Bar Force

WaveWeisBarForce is a custom indicator based on Weis Waves logic. It accumulates volume into directional waves (bullish or bearish) and displays them as histograms with intensity levels. Bullish waves: 4 levels of green, from light to Lime. Bearish waves: 4 levels of red, from light to Red. WaveMax (white): shows the bar with the highest volume inside each wave. WaveClimax (yellow): highlights record accumulated volume across waves. This indicator helps traders visualise market pressure by volume accumulation and wave intensity, improving intraday and swing analysis.