MetaTrader 4 / Indicatori

Tipu MACD - indicatore per MetaTrader 4

74219
(39)

Tipu MACD is one the popular indicators in the market. It is based on the MACD Oscillator that was devised by Gerald Appel in late 1970s. MACD is a Momentum Oscillator that is calculated by subtracting the two price moving averages calculated on the price. It is one of the simplest indicators that provides best of both trend and momentum. You may read about Tipu MACD here.

I have modified the original code for Tipu MACD published in the Market by removing the compatibility with Tipu Panel. This version of Tipu MACD is for learning purposes and is open for anyone who is interested in developing an Expert Advisor using this indicator.

Here is an example of how to use Tipu MACD in an Expert Advisor.

int iSignal, //signals iTrend; //trend //--Method#1 iSignal = iCustom(_Symbol,_Period,"Tipu MACD",2,12,26,9,PRICE_CLOSE,"",1,5,clrBlue,clrRed,true,true,"",1,false,false,false,7,0); iTrend = iCustom(_Symbol,_Period,"Tipu MACD",2,12,26,9,PRICE_CLOSE,"",1,5,clrBlue,clrRed,true,true,"",1,false,false,false,8,0); if (iSignal == OP_BUY) //for sell use OP_SELL { } if(iTrend == OP_BUY) //for sell use OP_SELL { }

//--Method#2 bool BuySignal = iCustom(_Symbol,_Period,"Tipu MACD",2,12,26,9,PRICE_CLOSE,"",1,5,clrBlue,clrRed,true,true,"",1,false,false,false,9,0); bool SellSignal = iCustom(_Symbol,_Period,"Tipu MACD",2,12,26,9,PRICE_CLOSE,"",1,5,clrBlue,clrRed,true,true,"",1,false,false,false,10,0);