Download Trend Magic MT4 Indicator

tm-0Trend magic is mainly based on the original Commodity Channel Index (CCI) indicator but it is combined with the Average True Range (ATR) indicator. This makes Trend magic indicator more reliable when it comes to identifying trends.

I know some traders use this indicator to determine stop-loss levels. That is a good choice because you wouldn’t want to be holding a position once the trend is reversing.

How to Trade With Trend Magic:

Buy Signal:

-Trend magic line has to be blue and the price bar has to close above the Trend magic line.

Sell Signal:

-Trend magic line has to be red and the price bar has to close below the Trend magic line.

Trend Magic MT4 Indicator – is great solution for your stops. If you don’t know how to set-up sto pin your strategy use this indicator. Actually you can build whole trading strategy based on this indicator!

 

[php]</pre>
//+——————————————————————+
//| TrendMagic.mq4 |
//| Tidied up by TudorGirl 28 May 2009 |
//| [email protected] |
//+——————————————————————+

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_width1 2
#property indicator_color2 Red
#property indicator_width2 2

//+——————————————————————+

extern int CCI = 50;
extern int ATR = 5;

//+——————————————————————+

double bufferUp[];
double bufferDn[];

//+——————————————————————+

int init()
{
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
SetIndexBuffer(0, bufferUp);
SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
SetIndexBuffer(1, bufferDn);
return (0);
}

//+——————————————————————+

int deinit()
{
return (0);
}

//+——————————————————————+

int start()
{
double thisCCI;
double lastCCI;

int counted_bars = IndicatorCounted();
if (counted_bars < 0) return (-1);
if (counted_bars > 0) counted_bars–;
int limit = Bars – counted_bars;

for (int shift = limit; shift >= 0; shift–)
{
thisCCI = iCCI(NULL, 0, CCI, PRICE_TYPICAL, shift);
lastCCI = iCCI(NULL, 0, CCI, PRICE_TYPICAL, shift + 1);

if (thisCCI >= 0 && lastCCI < 0) bufferUp[shift + 1] = bufferDn[shift + 1];
if (thisCCI <= 0 && lastCCI > 0) bufferDn[shift + 1] = bufferUp[shift + 1];

if (thisCCI >= 0)
{
bufferUp[shift] = Low[shift] – iATR(NULL, 0, ATR, shift);
if (bufferUp[shift] < bufferUp[shift + 1])
bufferUp[shift] = bufferUp[shift + 1];
}
else
{
if (thisCCI <= 0)
{
bufferDn[shift] = High[shift] + iATR(NULL, 0, ATR, shift);
if (bufferDn[shift] > bufferDn[shift + 1])
bufferDn[shift] = bufferDn[shift + 1];
}
}
}

return (0);
}

//+——————————————————————+
//+——————————————————————+

&nbsp;
<pre>[/php]

Click Here to Download

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *