Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Facebook !
Rejoignez notre page de fans
Rejoignez notre page de fans
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
- Publié par:
- Vladimir Karputov
- Vues:
- 8337
- Note:
- Publié:
- 2017.01.26 09:07
-
Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance
Author of the idea — Gabriel, author of the MQL5 code — barabashkakvn.
Works based on the iMACD (MACD) indicators.
Conditions to check the signals for opening a position:
void OpenBuyOrSell()
{
double mac1,mac2,mac3,mac4,mac5,mac6,mac7,mac8;
mac1 = iMACDGet(MAIN_LINE,0);
mac2 = iMACDGet(MAIN_LINE,1);
mac3 = iMACDGet(MAIN_LINE,2);
mac4 = iMACDGet(MAIN_LINE,3);
mac5 = iMACDGet(SIGNAL_LINE,0);
mac6 = iMACDGet(SIGNAL_LINE,1);
mac7 = iMACDGet(SIGNAL_LINE,2);
mac8 = iMACDGet(SIGNAL_LINE,3);
//--- check for long position (BUY) possibility
if(mac8>mac7 && mac7>mac6 && mac6<mac5 && mac4>mac3 && mac3<mac2 && mac2<mac1 && mac2<-0.00020 && mac4<0 && mac1>0.00020)
{
if(!RefreshRates())
return;
double volume=LotsOptimized();
if(volume==0)
return;
m_trade.Buy(volume,Symbol(),m_symbol.Bid(),0,0,"Expert MACD");
return;
}
//--- check for short position (SELL) possibility
if(mac8<mac7 && mac7<mac6 && mac6>mac5 && mac4<mac3 && mac3>mac2 && mac2>mac1 && mac2>0.00020 && mac4>0 && mac1<-0.00035)
{
if(!RefreshRates())
return;
double volume=LotsOptimized();
if(volume==0)
return;
m_trade.Sell(volume,Symbol(),m_symbol.Ask(),0,0,"Expert MACD");
return;
}
}
{
double mac1,mac2,mac3,mac4,mac5,mac6,mac7,mac8;
mac1 = iMACDGet(MAIN_LINE,0);
mac2 = iMACDGet(MAIN_LINE,1);
mac3 = iMACDGet(MAIN_LINE,2);
mac4 = iMACDGet(MAIN_LINE,3);
mac5 = iMACDGet(SIGNAL_LINE,0);
mac6 = iMACDGet(SIGNAL_LINE,1);
mac7 = iMACDGet(SIGNAL_LINE,2);
mac8 = iMACDGet(SIGNAL_LINE,3);
//--- check for long position (BUY) possibility
if(mac8>mac7 && mac7>mac6 && mac6<mac5 && mac4>mac3 && mac3<mac2 && mac2<mac1 && mac2<-0.00020 && mac4<0 && mac1>0.00020)
{
if(!RefreshRates())
return;
double volume=LotsOptimized();
if(volume==0)
return;
m_trade.Buy(volume,Symbol(),m_symbol.Bid(),0,0,"Expert MACD");
return;
}
//--- check for short position (SELL) possibility
if(mac8<mac7 && mac7<mac6 && mac6>mac5 && mac4<mac3 && mac3>mac2 && mac2>mac1 && mac2>0.00020 && mac4>0 && mac1<-0.00035)
{
if(!RefreshRates())
return;
double volume=LotsOptimized();
if(volume==0)
return;
m_trade.Sell(volume,Symbol(),m_symbol.Ask(),0,0,"Expert MACD");
return;
}
}
Opening Buy on the chart:
Traduit du russe par MetaQuotes Ltd.
Code original : https://www.mql5.com/ru/code/16967
![Fractal_Bands_HTF](https://c.mql5.com/i/code/indicator.png)
The Fractal_Bands indicator with the timeframe selection option available in the input parameters.
![Fractal_CCI](https://c.mql5.com/i/code/indicator.png)
Fractal Commodity Channel Index.
![GO](https://c.mql5.com/i/code/expert.png)
Signals based on four iMA (MA) indicators, by PRICE_OPEN, PRICE_HIGH, PRICE_LOW, PRICE_CLOSE prices. Trades only on hedge accounts.
![Fractal_Keltner_HTF](https://c.mql5.com/i/code/indicator.png)
The Fractal_Keltner indicator with the timeframe selection option available in the input parameters.