Assista a como baixar robôs de negociação gratuitos
Encontre-nos em Facebook!
Participe de nossa página de fãs
Script interessante?
Coloque um link para ele, e permita que outras pessoas também o avaliem
Você gostou do script?
Avalie seu funcionamento no terminal MetaTrader 5
Experts

Scalper noturno multimoeda Night Scalper Multi - expert para MetaTrader 5

Visualizações:
3464
Avaliação:
(38)
Publicado:
2017.01.09 10:57
Precisa de um robô ou indicador baseado nesse código? Solicite-o no Freelance Ir para Freelance

O scalper noturno multimoeda Night Scalper Multi opera até a meia-noite dentro de um intervalo estreito (r) definido pelo indicador Bollinger Bands.

BBHandle=iBands(symb,0,per,0,dev,0);
   CopyBuffer(BBHandle,1,0,1,up);
   CopyBuffer(BBHandle,2,0,1,dn);

   double r=up[0]-dn[0];

A posição se abre após da hora definida na variável Start, e quando não há posições abertas no símbolo.

if(CountTrades(symb)<1 && TimeCurrent()>StringToTime(s))

Compramos quando o preço está abaixo do limite inferior do Bollinger Bands e o canal e inferior ao intervalo definido na variável Razmah.

if(Ask<dn[0] && r<razmah*_Point) trade.PositionOpen(symb,0,Lot,Ask,Ask-stop*_Point,Ask+take*_Point);

Vendemos quando o preço está acima do limite superior do Bollinger Bands e o canal e inferior ao intervalo definido na variável Razmah.

if(Bid>up[0] && r<razmah*_Point) trade.PositionOpen(symb,1,Lot,Bid,Bid+stop*_Point,Bid-take*_Point);

O fechamento da posição ocorre segundo os stops ou, forçosamente, após 12 horas da noite.

else if(CountTrades(symb)>0 && TimeCurrent()<StringToTime(s)) CloseAll(symb);

Negociamos usando a função SymbolTrade e utilizamos a classe CTrade:

void SymbolTrade(string symb,int stop,int take,int per,double dev,double razmah,int start)
  {
   string s=(string)start+":00";
   double Ask=SymbolInfoDouble(symb,SYMBOL_ASK);
   double Bid=SymbolInfoDouble(symb,SYMBOL_BID);

   BBHandle=iBands(symb,0,per,0,dev,0);
   CopyBuffer(BBHandle,1,0,1,up);
   CopyBuffer(BBHandle,2,0,1,dn);

   double r=up[0]-dn[0];

   if(CountTrades(symb)<1 && TimeCurrent()>StringToTime(s))
     {
      if(Ask<dn[0] && r<razmah*_Point) trade.PositionOpen(symb,0,Lot,Ask,Ask-stop*_Point,Ask+take*_Point);
      if(Bid>up[0] && r<razmah*_Point) trade.PositionOpen(symb,1,Lot,Bid,Bid+stop*_Point,Bid-take*_Point);
     }
   else if(CountTrades(symb)>0 && TimeCurrent()<StringToTime(s)) CloseAll(symb);
  }

Transações são realizadas na nova barra:

if(bars!=Bars(NULL,0))
     {
      if(Symbol1!="") SymbolTrade(Symbol1,StopLoss1,TakeProfit1,BBPeriod1,BBDev1,Razmah1,Start1);
      if(Symbol2!="") SymbolTrade(Symbol2,StopLoss2,TakeProfit2,BBPeriod2,BBDev2,Razmah2,Start2);
      if(Symbol3!="") SymbolTrade(Symbol3,StopLoss3,TakeProfit3,BBPeriod3,BBDev3,Razmah3,Start3);
        ...
     }
   bars=Bars(NULL,0);


Opções:

input string Symbol1     = "USDCAD";       // Symbol1 Name
input int    StopLoss1   = 370;            // StopLoss1
input int    TakeProfit1 = 20;             // TakeProfit1
input int    BBPeriod1   = 40;             // Bands Period1
input double BBDev1      = 1;              // Bands Deviation1
input double Razmah1     = 450;            // Bands Deviation1 in Points
input int    Start1      = 19;             // Start Time1

input string Symbol2     = "GBPUSD";       // Symbol2 Name
input int    StopLoss2   = 450;            // StopLoss2
input int    TakeProfit2 = 80;             // TakeProfit2
input int    BBPeriod2   = 8;              // Bands Period2
input double BBDev2      = 1;              // Bands Deviation2
input double Razmah2     = 200;            // Bands Deviation2 in Points
input int    Start2      = 20;             // Start Time2

input string Symbol3     = "NZDUSD";       // Symbol3 Name
input int    StopLoss3   = 410;            // StopLoss3
input int    TakeProfit3 = 40;             // TakeProfit3
input int    BBPeriod3   = 4;              // Bands Period3
input double BBDev3      = 1.2;            // Bands Deviation3
input double Razmah3     = 450;            // Bands Deviation3 in Points
input int    Start3      = 19;             // Start Time3

input string Symbol4     = "";             // Symbol4 Name
input int    StopLoss4   = 500;            // StopLoss4
input int    TakeProfit4 = 40;             // TakeProfit4
input int    BBPeriod4   = 24;             // Bands Period4
input double BBDev4      = 1;              // Bands Deviation4
input double Razmah4     = 200;            // Bands Deviation4 in Points
input int    Start4      = 20;             // Start Time4

input string Symbol5     = "";             // Symbol5 Name
input int    StopLoss5   = 500;            // StopLoss5
input int    TakeProfit5 = 40;             // TakeProfit5
input int    BBPeriod5   = 24;             // Bands Period5
input double BBDev5      = 1;              // Bands Deviation5
input double Razmah5     = 200;            // Bands Deviation5 in Points
input int    Start5      = 20;             // Start Time5

input string Symbol6     = "";             // Symbol6 Name
input int    StopLoss6   = 500;            // StopLoss6
input int    TakeProfit6 = 40;             // TakeProfit6
input int    BBPeriod6   = 24;             // Bands Period6
input double BBDev6      = 1;              // Bands Deviation6
input double Razmah6     = 200;            // Bands Deviation6 in Points
input int    Start6      = 20;             // Start Time6

input string Symbol7     = "";             // Symbol7 Name
input int    StopLoss7   = 500;            // StopLoss7
input int    TakeProfit7 = 40;             // TakeProfit7
input int    BBPeriod7   = 24;             // Bands Period7
input double BBDev7      = 1;              // Bands Deviation7
input double Razmah7     = 200;            // Bands Deviation7 in Points
input int    Start7      = 20;             // Start Time7

input string Symbol8     = "";             // Symbol8 Name
input int    StopLoss8   = 500;            // StopLoss8
input int    TakeProfit8 = 40;             // TakeProfit8
input int    BBPeriod8   = 24;             // Bands Period8
input double BBDev8      = 1;              // Bands Deviation8
input double Razmah8     = 200;            // Bands Deviation8 in Points
input int    Start8      = 20;             // Start Time8

input string Symbol9     = "";             // Symbol9 Name
input int    StopLoss9   = 500;            // StopLoss9
input int    TakeProfit9 = 40;             // TakeProfit9
input int    BBPeriod9   = 24;             // Bands Period9
input double BBDev9      = 1;              // Bands Deviation9
input double Razmah9     = 200;            // Bands Deviation9 in Points
input int    Start9      = 20;             // Start Time9

input double Lot         = 1;              // Trade Volume

Fig.1. Resultados do Expert Advisor na negociação. EURUSD, H1

Fig.2. Transações do Expert Advisor no diário

Fig.3. Resultados do Expert Advisor na negociação de 11.01.2016 a 13.09.2016. USDCAD, GBPUSD, NZDUSD, H1


Dicas:

  • Recomenda-se usar o Expert Advisor como assistente na negociação e para desenvolvimento de suas próprias estratégias de negociação.

Traduzido do russo pela MetaQuotes Ltd.
Publicação original: https://www.mql5.com/ru/code/16350

Expert inteligente de cálculo de médias Hello Smart Expert inteligente de cálculo de médias Hello Smart

O Expert Advisor calcula a média das posições não-rentáveis seguindo um algoritmo predeterminado.

XvaMA_HTF XvaMA_HTF

Indicador XvaMA com possibilidade de alterar o timeframe do indicador nos parâmetros de entrada.

JSatl_HTF JSatl_HTF

Indicador JSatl com possibilidade de alterar o timeframe do indicador nos parâmetros de entrada.

AFL_WinnerV2_HTF AFL_WinnerV2_HTF

Indicador AFL_WinnerV2 com possibilidade de alterar o timeframe do indicador nos parâmetros de entrada.