CROSS INDICATOR

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

CROSS INDICATOR

Postby modanetfx » Mon Sep 21, 2015 3:51 pm

Please can anybody help me to add a pop up notification and a sound alert to this cross indicator?
Code: Select all
/*[[
   Name := EMA Cross
   Author := Hapsa
   Link := http://www.metaquotes.net/
   Separate Window := No
   Separate Window := No
   First Color := Red
   First Draw Type := Symbol
   First Symbol := 108
   Use Second Data := Yes
   Second Color := DarkOliveGreen
   Second Draw Type := Symbol
   Second Symbol := 108
]]*/


#property copyright "Hapsa"
#property link      ""
extern int SlowPeriod=20;
extern int FastPeriod=5;

#property indicator_buffers 3
#property indicator_chart_window
#property indicator_color1 Red
#property indicator_color2 Green
double L20[];
double L50[];
double shift=0,val1=0,val2=0;

int init()
  {
 
IndicatorBuffers(3);
SetIndexStyle(0,DRAW_ARROW);
SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(0, 108);
SetIndexArrow(1, 108);

SetIndexBuffer(0,L20);
SetIndexBuffer(1,L50);


 

//---- indicators
//----
   return(0);
  }





int start()
  {
   
   
   int    counted_bars=IndicatorCounted();
//----
   int i = Bars - counted_bars - 1;
   while (i>=0)
   {
   
   val1=0;
   val2=0;
   
   double iMaSlowPrevious = iMA(NULL,0,SlowPeriod,0,MODE_EMA, PRICE_CLOSE, i-1);
   double iMaSlowCurrent = iMA(NULL,0,SlowPeriod,0,MODE_EMA, PRICE_CLOSE, i);
   double iMaFastPrevious = iMA(NULL,0,FastPeriod,0,MODE_EMA, PRICE_CLOSE, i-1);
   double iMaFastCurrent = iMA(NULL,0,FastPeriod,0,MODE_EMA, PRICE_CLOSE, i);
   
   if (iMaFastPrevious<iMaSlowPrevious && iMaFastCurrent>iMaSlowCurrent ) val1=High[i];
   if (iMaFastPrevious>iMaSlowPrevious && iMaFastCurrent<iMaSlowCurrent ) val2=Low[i];   
    L20[i]=val1+5*Point;
    L50[i]=val2-5*Point;
     i--;
   }

//----
   return(0);
}
modanetfx
 
Posts: 2
Joined: Mon Sep 21, 2015 3:28 pm

Re: CROSS INDICATOR

Postby Apprentice » Wed Sep 23, 2015 5:20 am

Your request is added to the development list.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36420
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: CROSS INDICATOR

Postby modanetfx » Wed Sep 23, 2015 5:38 am

Thanks , i shall be glad you helped .
modanetfx
 
Posts: 2
Joined: Mon Sep 21, 2015 3:28 pm

Re: CROSS INDICATOR

Postby Alexander.Gettinger » Thu Dec 13, 2018 12:43 pm

Please, try this version of indicator:
Cross_Ind.mq4
(2.11 KiB) Downloaded 420 times
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 8 guests