Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2014.08.28 15:52

WelchCandlesticks_v2 - indicator for MetaTrader 4

| English Español Português 日本語 Deutsch

Published by:
Tim Welch
votes: 13

Real author:

Tim Welch


The basic candlesticks that are built into MetaTrader 4 have a rudimentary, and potentially devastating flaw. They never show you the Ask line, and, they never save that Ask price in the history. This situation can be compounded when/if a broker chooses to send the Bid data through to your MetaTrader 4 as an "averaged price" calculated by averaging Bid and Ask together. I know of one such broker who does this, so I can imagine that there are more than just one.

In MetaTrader 4 the calculation of candlesticks is based on Bid data, to see the current Ask price you need to check "Show Ask line" in the chart properties. It's important to see the Ask prices when placing Stop Loss.

To see the situation in a live chart, and for full effect I recommend opening up a 1M chart: Open up a blank chart -> open chart Properties -> change the chart style to candlesticks -> and then make sure you have the "Show ASK lines" activated.

Show Ask lines

You will immediately see a RED line pop up on the chart. Watch this RED line, it will have no affect whatsoever on the building of the candlesticks unless/until someone actually buys at the ASK price.

This ASK price is valuable in determining a stop loss. If you see the ASK price consistently above (or as in a time of SPREAD increase, way above) the price historically, you can more accurately place your stop loss when making a new trade.

How to remedy this? Well, unfortunately, there is no way to remedy this for the PAST without creating offline charts with the data included, because the historical data on a chart does not save the ASK, only the BID.

BUT, there is a way to remedy this on a live chart. The first way is the way I already showed you.  The second way is to where WelchCandlesticks_v2 comes into play.

When you add this indicator to the chart, it will build all new candlesticks with the spread data included as part of the WICKS for the candlesticks. This doesn't affect OPEN/CLOSE/LOW, only HIGH. (Bid is always the LOW, so it doesn't affect that, which is why I was only getting stop lossed out of my SELL trades, because they would reverse and the spread would rise higher and take me out before I could see it happening and close my positions... The automated way to fix this for when you're not watching the chart is to always watch the ASK price and calculate the spread and what-not, but I wanted to visually see when I was cut out of a trade so I could better understand why...)

Below you will see 2 charts. One with normal candlesticks and one overlaid with my candlesticks. You should be able to spot the Lime lines pretty easily, which is where the spread goes above what the candlestick HIGH would have told you...

This is from AUDJPY today (2014/08/25)

candle 1


candle 2

And one more chart showing an ENORMOUS spread spike a while back just before the price went further down...


I've been using this for the past few years now with good success. It's just something that I've found gives me a slight edge in the grand scheme of things. It's not an overnight money maker, by any means, and in fact it won't make you money at all! But it should at least help you to visually see when your broker is changing the spread because now it's being reflected in the candlestick formation, which you can use to more accurately place your stops and not get kicked out of a trade when it might just be challenging a price before making a huge swing in the direction you initially placed your trade. :-)

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

TP-SL_Removing TP-SL_Removing

Immediately deletes the SL/TP of all positions.

Closed_TOTAL Closed_TOTAL

Total closure of all positions (winners/losers). You can also select which are of a single instrument.