Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-25-2006, 10:13 PM
summitfx's Avatar
Senior Member
 
Join Date: Jul 2006
Posts: 289
summitfx is on a distinguished road
Need Alert Programmed???

Can someone program a simple alert (text message or alarm) for this lsma indicator for when the line changes color. Thanks

//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Yellow
#property indicator_color2 Chartreuse
#property indicator_color3 Red

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
int width;

extern int Rperiod = 34;
extern int Draw4HowLongg = 300; // 500 // 1000
int Draw4HowLong;
int shift;
int i;
int loopbegin;
double sum[];
int length;
double lengthvar;
double tmp ;
double wt[];
int c;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- 2 additional buffers are used for counting.
IndicatorBuffers(5);

//---- drawing settings
SetIndexBuffer(2,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(0,ExtMapBuffer3);
SetIndexBuffer(3,sum);
SetIndexBuffer(4,wt);

SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,3);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,3);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);

//---- initialization done
return(0);
}

int start()

{ Draw4HowLong = Bars-Rperiod - 5;
length = Rperiod;
loopbegin = Draw4HowLong - length - 1;

for(shift = loopbegin; shift >= 0; shift--)
{
sum[1] = 0;
for(i = length; i >= 1 ; i--)
{
lengthvar = length + 1;
lengthvar /= 3;
tmp = 0;
tmp = ( i - lengthvar)*Close[length-i+shift];
sum[1]+=tmp;
}
wt[shift] = sum[1]*6/(length*(length+1));

//========== COLOR CODING ===========================================

ExtMapBuffer3[shift] = wt[shift]; //red
ExtMapBuffer2[shift] = wt[shift]; //green
ExtMapBuffer1[shift] = wt[shift]; //yellow

// for(c=loopbegin;c==shift;c++)
// {
if (wt[shift+1] > wt[shift])
{
ExtMapBuffer2[shift+1] = EMPTY_VALUE;
// ObjectCreate("smiley_face", OBJ_ARROW, 0, Time[shift], Low[shift]-Point*20);
// Print("time= ",Time[shift]);
// ObjectSet("smiley_face", OBJPROP_ARROWCODE, 242);
// ObjectSet("smiley_face", OBJPROP_COLOR , Red);
// ObjectSet("smiley_face", OBJPROP_WIDTH , 1);
// ObjectsRedraw();

//ExtMapBuffer3[shift+1] = EMPTY_VALUE;
//ExtMapBuffer3[shift+1] = EMPTY_VALUE;

}
else if (wt[shift+1] < wt[shift])
{
ExtMapBuffer1[shift+1] = EMPTY_VALUE; //-1 red/greem tight
//ExtMapBuffer3[shift+1] = EMPTY_VALUE;

}
else
{

ExtMapBuffer1[shift+1]=CLR_NONE;//EMPTY_VALUE;
ExtMapBuffer2[shift+1]=CLR_NONE;//EMPTY_VALUE;
}

}

return(0);
}
//+------------------------------------------------------------------+
Attached Images
File Type: gif ff.gif (25.1 KB, 61 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-25-2006, 10:56 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Smile

I am not a programmer, but this coding, if you can find a place for it in your program works:

{
Alert(Symbol(), AccountNumber(), " BUY NOW! = ",Ask);
PlaySound("alert.wav");
}

Dave
<><<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EMA with alert? pipmonger12 Metatrader 4 6 10-17-2008 12:47 PM
I need a simple indicator programmed SaxMan Indicators - Metatrader 4 1 08-08-2006 08:26 PM
need easily programmed ind mcsqueeze Metatrader 4 2 07-16-2006 07:16 AM
EMA Alert help !!!!!!!!!! compro99 Expert Advisors - Metatrader 4 12 06-19-2006 11:51 AM


All times are GMT. The time now is 06:46 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.