Loading…

Livermore Pivotal Point System

Attribution: this implements the Pivotal Point method described by Jesse Livermore, as reconstructed in Richard Smitten's "How to Trade in Stocks" from Livermore's own writings and trading records. It is an original, objective implementation of the method's rules, not a copy of any published source code. Livermore's central idea was to trade "the line of least resistance" and to treat the market's own pauses as the signal, not a fixed indicator. A PIVOTAL POINT is the market's last significant swing extreme (found here with a standard N-bar-either-side fractal). His rule was explicit that breaking through that extreme is only worth trading AFTER the market has genuinely reacted (pulled back, in an uptrend) or rallied (bounced, in a downtrend) away from it first - chasing a break with no rest beforehand is gambling on momentum, not trading the resumption of an established trend. This EA encodes that rest requirement directly: a pivotal point only arms for breakout once price has moved at least InpMinReactionAtr ATR multiples away from it. Trend direction itself is read the same objective way: two consecutive higher swing highs and higher swing lows confirm an uptrend, the mirror confirms a downtrend, and the direction only flips on that confirmation rather than on every single pivot. Once armed, a close back through the pivotal point in the trend's own direction is the entry. In keeping with Livermore's rule to add to winners rather than average into losers, further units can be added (pyramided) at each fresh pivotal point while the trend holds, each one SMALLER than the last (InpPyramidLotScale) and each stopped independently just beyond its own reaction extreme. Notes and limitations - Fractal-based swing detection needs InpSwingLookback bars closed on BOTH sides of a candidate pivot, so a pivot is only recognised InpSwingLookback bars after it actually formed - inherent lag in any swing-based method, not a bug. - Pyramided units are independent MQL4 tickets (always hedging on MQL4), each with its own stop; there is no shared trailing stop across units in this build. - If the trend read flips while units from the old trend are still open, no new unit is added against them - they are left to their own stops rather than closed out automatically. - No hardcoded contract size; lot sizing is fixed per unit and normalised to the symbol's MODE_LOTSTEP/MIN/MAXLOT.

Expert advisor · MT4 · v1.0 · Free

About Livermore Pivotal Point System

Livermore Pivotal Point System is an expert advisor (trading robot) for MetaTrader 4 based on ATR. It trades breakouts. It has 11 settings, such as Swing lookback, Min reaction atr and Atr period. MQL source code included.

Files in the download: LivermorePivotalPoints.ex4, LivermorePivotalPoints.mq4, LivermorePivotalPoints.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Swing lookback5Bars each side required to confirm a swing high/low (fractal width)
Min reaction atr0.8Minimum pullback/bounce from the pivotal point, ATR multiples, before a breakout counts
Atr period14ATR period
Initial stop atr1.5Initial stop distance beyond the reaction extreme, ATR multiples
Max pyramid units3Maximum units allowed on at once (1 = no pyramiding)
First unit lots0.10Lot size of the first unit
Pyramid lot scale0.5Each added unit's lots = previous unit's lots * this factor (Livermore added SMALLER, not equal, siz
Magic number20260421Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Order-send attempts before giving up
Retry wait ms500Pause between attempts, milliseconds

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: Trend · Breakout · ATR · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria