Jump to content

[REQ] forex***signals***alerts from K.DittMann


Recommended Posts

  • 1 year later...
404 Not Found

 

The resource requested could not be found on this server!

 

Please reupload. thanks

 

 

Well this old thread may have been erased when II changed their server.

Looking on my HD, found that but not sure it is the one discussed here?

But don't rely too much on it, it is just a MAs crossover.

 


//+------------------------------------------------------------------+
//|                                     forexsecretsignalsalerts.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Karl Dittmann"
#property link      ""

#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 Green
#property indicator_color4 CadetBlue
#property indicator_style4 STYLE_DOT
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_level1 0

extern bool   soundAlerts = true;
extern bool   emailAlerts = false;
      int    Period.1    = 13;
      int    Period.2    = 8;
      int    Period.3    = 15;

double temp[];

double Main[];
double Short[];
double Long[];
double Signal[];

int init()
{

  IndicatorBuffers(5);

  SetIndexStyle(0,DRAW_LINE);
  SetIndexBuffer(0,Main);
  SetIndexStyle(1,DRAW_LINE);
  SetIndexBuffer(1,Short);
  SetIndexStyle(2,DRAW_LINE);
  SetIndexBuffer(2,Long);
  SetIndexStyle(3,DRAW_NONE);
  SetIndexBuffer(3,Signal);

  SetIndexBuffer(4, temp);

  return(0);
}

int deinit()
{

  return(0);
}

int start()
{

  //Calculate main line
  for(int i=0; i < Bars; i++)
  {
     Main[i] = EMPTY_VALUE;
     Signal[i] = EMPTY_VALUE;
     Long[i] = EMPTY_VALUE;
     Short[i] = EMPTY_VALUE;
     temp[i] = (Close[i] - iMA(Symbol(), 0, Period.1, 0, MODE_SMA, PRICE_CLOSE, i));
  }
  
  //Calculate signal line
  for(i=0; i < Bars; i++)
     Main[i] = iMAOnArray(temp, 0, Period.2, 0, MODE_SMA, i);
  
  for(i=0; i < Bars; i++)
     Signal[i] = iMAOnArray(Main, 0, Period.3, 0, MODE_SMA, i);
  
  double ATR = iATR(Symbol(), 0, 50, 1);
  double StopLoss;
  
  for(i=0; i < Bars; i++)
  {
     if(Main[i] > Signal[i])
     {  Long[i] = Main[i];
     }
     else
     {
        Short[i] = Main[i];
     }
  }
  
  if(Long[1] != EMPTY_VALUE && Long[2] == EMPTY_VALUE && High[0] == Low[0] && High[0] == Close[0] && High[0] == Low[0])
  {
           StopLoss = Low[1] - ATR;
  
     //Alert Long
     if(soundAlerts)
        Alert("Long trade in Karl Dittmann Signal, at " + Symbol() + "! Stop Loss at " + StopLoss);
     
     if(emailAlerts)
        SendMail("Long trade in Karl Dittmann Signal, at " + Symbol() + "!", "Long trade in Karl Dittmann Signal, at " + Symbol() + "! Stop Loss at " + StopLoss);
  }
  
  if(Short[1] != EMPTY_VALUE && Short[2] == EMPTY_VALUE && High[0] == Low[0] && High[0] == Close[0] && High[0] == Low[0])
  {
           StopLoss = High[1] + ATR;
  
     //Alert Short
     if(soundAlerts)
        Alert("Short trade in Karl Dittmann Signal, at " + Symbol() + "! Stop Loss at " + StopLoss);

     if(emailAlerts)
        SendMail("Short trade in Karl Dittmann Signal, at " + Symbol() + "!", "Short trade in Karl Dittmann Signal, at " + Symbol() + "! Stop Loss at " + StopLoss);
  }
  
  return(0);
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...