Attachments forums

List of attachments posted on this forum.


All files on forums: 135833

Re: MT4 Indicator requests and ideas

TransparentTrader, Tue Apr 16, 2024 3:15 am

"Expansion Contraction Indicator" by Brian Latta

mrtools, kvak, and the master coders here, I was wondering if it would be possible to have this indicator ported for MT4.

Here is a detailed description from its TradingView page, which has the indicator available for free use but the source code protected:
Expansion Contraction compares 2 price points (the high and the low), up or down through the 2 moving average channel (MAC) settings. Since Expansion Contraction measures every period (chart setting), it technically has “zero lag”. A second indicator compares 2 price points (the high and the low), up or down through 2 longer look-back moving average channel settings… Note: Ideally, this ratio usually produces a condition where a 2 standard deviation short term move (strong swing) equals approximately a 1 standard deviation long term move (trend strengthening).

Basically, if both the short term swing is expanding higher and the long term trend is expanding higher, then that signals the strongest part of the current swing higher (dark green bars). The strongest part of the current swing lower (dark red bars), occurs when both the short term swing is expanding lower and the long term trend is expanding lower.

Light green bars occur when the short term swing is expanding lower however; the long term trend is still bullish. Light red bars occur when the short term swing is higher however; the long term trend is still bearish. These indicate weakness in the current swing and Jake’s trailing stop rules should be considered.

When both the short term swing and the long term trend are within 1 standard deviation based on the short term swing, the resulting narrow range indicates a “not trending” or range bound condition.

When the short term swings are at or beyond +2 standard deviations, this setup is a leading indicator of the trend direction most of the time (not how long the trend will last). When the long term trend, up or down exceeds a 2 standard deviation move higher, the condition is considered over-bought or over-sold, respectively. Trade Navigator programming appears as a colored triangle (red/green). Use trailing stop rules.

Indicator created by Brian Latta based on Jake Bernstein’s principles of Moving Average Channel system.

Brian Latta - Author of “The Book on Trading”, trading system developer and coach
Jake Bernstein - Speaker at Wealth365®


Fortunately, the official website for this indicator has numerous versions available. TradeNavigator, TradingView, TradeStation, ThinkOrSwim, NinjaTrader, MetaStock, and MetaTrader 5.

Turns out the MetaTrader 5 version comes as an mq5 file, so the conversion to MQL4 shouldn't be too difficult. It's attached to this post.



Now, while Jake Bernstein has two paid webinars (here and here) to show people how to use this indicator, Brian Latta writes about this in pages 140-152 of his free book "The Book on Trading – The Secret Language of the Markets" (2008). I've also attached it below.


And for anyone who's interested, MetaStock is hosting a free hour-long webinar about this indicator on Wednesday April 17 from 6pm-7pm EST. Just something to put here, I get no favors or kickbacks from mentioning it.

EDIT: The webinar has happened and is free to watch on YouTube:



Hope I didn't overload you guys with too much unnecessary information. Much appreciated if this request can be fulfilled!

EDIT 2: kvak just posted his version of the indicator for MT4 here and I shared my thoughts about how accurate it is compared to the original version here.
All files in topic