Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


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 (1) Thread Tools Display Modes
  #11 (permalink)  
Old 11-17-2005, 02:40 PM
hua hua is offline
Member
 
Join Date: Oct 2005
Location: Athens
Posts: 75
hua is on a distinguished road
Quote:
Originally Posted by codersguru
Hua,

Please try this code.
Don't forget to enable "Allow Dll imports"
Sorry but Alpari's platforma crashed and had to reopen but freezes continuously.
As told yu in the past, Alpari alerts window hv a list of all alerts (very good indeed as yu can see your alerts at any time), There4 we need alert to hit only once. But, in this case coming another popup window (for only this alert) which freezes the computer. Its ok Sir, dont bother anymore. Yu hv a lot of valuable things to do with other members requests. Thanks again your nice assistance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 11-17-2005, 03:08 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow

Quote:
Originally Posted by hua
Sorry but Alpari's platforma crashed and had to reopen but freezes continuously.
As told yu in the past, Alpari alerts window hv a list of all alerts (very good indeed as yu can see your alerts at any time), There4 we need alert to hit only once. But, in this case coming another popup window (for only this alert) which freezes the computer. Its ok Sir, dont bother anymore. Yu hv a lot of valuable things to do with other members requests. Thanks again your nice assistance.
Hua,

It didn't crash with me, but you are right too, because:
http://www.metaquotes.net/forum/758/

Alerts seem better but there's no option to hit only once in indicators.
Attached Images
File Type: jpg msg.JPG (65.6 KB, 336 views)
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 11-17-2005, 06:32 PM
hua hua is offline
Member
 
Join Date: Oct 2005
Location: Athens
Posts: 75
hua is on a distinguished road
Quote:
Originally Posted by codersguru
Hua,

It didn't crash with me, but you are right too, because:
http://www.metaquotes.net/forum/758/

Alerts seem better but there's no option to hit only once in indicators.
Tks vm again, but hv a look on the attached indicator, this one hits alert only once. tks again.
Attached Files
File Type: mq4 ForexOffTrend_Alert.mq4 (4.6 KB, 136 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 11-17-2005, 10:44 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Unhappy

Quote:
Originally Posted by hua
Tks vm again, but hv a look on the attached indicator, this one hits alert only once. tks again.
Hua,

But "Disable alert once hit" Means "enable only first alert signal"

The indicator you've sent use an option to show alerts or not.
And you have to set this option from the properties windows of the indicator before starting the indicator.
And if you set it to false before starting the indicator you will not get even one alert.

it's not the idea of "Disable alert once hit"

Why didn't you tell me you want something like that? It's 2 lines of code
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 11-18-2005, 04:49 AM
hua hua is offline
Member
 
Join Date: Oct 2005
Location: Athens
Posts: 75
hua is on a distinguished road
Quote:
Originally Posted by codersguru
Hua,

But "Disable alert once hit" Means "enable only first alert signal"

The indicator you've sent use an option to show alerts or not.
And you have to set this option from the properties windows of the indicator before starting the indicator.
And if you set it to false before starting the indicator you will not get even one alert.

it's not the idea of "Disable alert once hit"

Why didn't you tell me you want something like that? It's 2 lines of code
Sorry Sir, i dont need that and its my mistake, i am really a bit confused.
So, forget it and tk yu once more. take care.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 11-20-2005, 10:13 PM
Senior Member
 
Join Date: Oct 2005
Location: Porto/Portugal
Posts: 265
hellkas is on a distinguished road
Question Some questions

hi codersguru...

I'd like to know how I can put 3 things:

1) Arrows in the chart;
2) Alert when cross;
3) Comment in the left corner;

the indicator its Stoch..

many tkx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 11-20-2005, 11:46 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow Answers

Quote:
Originally Posted by hellkas
hi codersguru...

I'd like to know how I can put 3 things:

1) Arrows in the chart;
2) Alert when cross;
3) Comment in the left corner;

the indicator its Stoch..

many tkx
hi hellkas,

1- Arrows in the chart;

Use this code to draw an arrow (color=Gold, Width=1) in the main window.

PHP Code:
ObjectCreate("my arrow"OBJ_ARROW0Time[0], High[0]+Point*10);
ObjectSet("my arrow"OBJPROP_ARROWCODE1);
ObjectSet("my arrow"OBJPROP_COLOR Gold);
ObjectSet("my arrow"OBJPROP_WIDTH  1);
ObjectsRedraw(); 

2) Alert when cross;


This is my Alerts demo (working when 8EMA crosses 13EMA and telles you the direction):

PHP Code:
//+------------------------------------------------------------------+
//|                                                CrossedAlerts.mq4 |
//|                                                      Coders Guru |
//|                                         http://www.forex-tsd.com |
//+------------------------------------------------------------------+
#property copyright "Coders Guru"
#property link      "http://www.forex-tsd.com"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   
SetIndexStyle(0,DRAW_LINE);
   
SetIndexBuffer(0,ExtMapBuffer1);
   
SetIndexStyle(1,DRAW_LINE);
   
SetIndexBuffer(1,ExtMapBuffer2);
//----
   
return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   
return(0);
  }

bool Crossed (double line1 double line2 ,stringdirection)
{

static 
string last_direction "";
string current_dirction "";

if(
line1>line2)current_dirction "up";
if(
line1<=line2)current_dirction "down";



if(
current_dirction != last_direction
{
      
Alert("CRROSED: Line1 is (" current_dirction ") Line2 now");
      
last_direction current_dirction;
      
direction=current_dirction
      return (
true);
}
else
{
      
direction=current_dirction;
      return (
false);

}
 

int start()
  {
   
int    counted_bars=IndicatorCounted();
 
//---- check for possible errors
   
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
   
if (counted_bars>0counted_bars--;
   
   
int pos=Bars-counted_bars;
   
     
 
   while(
pos>=0)
     {
         
ExtMapBuffer1[pos] = iMA(NULL,0,8,0,MODE_EMA,PRICE_CLOSE,pos);
         
ExtMapBuffer2[pos] = iMA(NULL,0,13,0,MODE_EMA,PRICE_CLOSE,0);
         
pos--;
     }
     
     
string direction;   
     Print(
Crossed (ExtMapBuffer1[0],ExtMapBuffer2[0],direction));
      
 
//----
   
return(0);
  }
//+------------------------------------------------------------------+ 
3) Comment in the left corner;

This line of code will print a comment on the top left corner of the main window:

PHP Code:
Comment("Hi! I'm here on the main chart windows!"); 
I hope I helped!
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 11-21-2005, 05:45 AM
hua hua is offline
Member
 
Join Date: Oct 2005
Location: Athens
Posts: 75
hua is on a distinguished road
Quote:
Originally Posted by codersguru
hi hellkas,

1- Arrows in the chart;

Use this code to draw an arrow (color=Gold, Width=1) in the main window.

PHP Code:
ObjectCreate("my arrow"OBJ_ARROW0Time[0], High[0]+Point*10);
ObjectSet("my arrow"OBJPROP_ARROWCODE1);
ObjectSet("my arrow"OBJPROP_COLOR Gold);
ObjectSet("my arrow"OBJPROP_WIDTH  1);
ObjectsRedraw(); 

2) Alert when cross;


This is my Alerts demo (working when 8EMA crosses 13EMA and telles you the direction):

PHP Code:
//+------------------------------------------------------------------+
//|                                                CrossedAlerts.mq4 |
//|                                                      Coders Guru |
//|                                         http://www.forex-tsd.com |
//+------------------------------------------------------------------+
#property copyright "Coders Guru"
#property link      "http://www.forex-tsd.com"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   
SetIndexStyle(0,DRAW_LINE);
   
SetIndexBuffer(0,ExtMapBuffer1);
   
SetIndexStyle(1,DRAW_LINE);
   
SetIndexBuffer(1,ExtMapBuffer2);
//----
   
return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   
return(0);
  }

bool Crossed (double line1 double line2 ,stringdirection)
{

static 
string last_direction "";
string current_dirction "";

if(
line1>line2)current_dirction "up";
if(
line1<=line2)current_dirction "down";



if(
current_dirction != last_direction
{
      
Alert("CRROSED: Line1 is (" current_dirction ") Line2 now");
      
last_direction current_dirction;
      
direction=current_dirction
      return (
true);
}
else
{
      
direction=current_dirction;
      return (
false);

}
 

int start()
  {
   
int    counted_bars=IndicatorCounted();
 
//---- check for possible errors
   
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
   
if (counted_bars>0counted_bars--;
   
   
int pos=Bars-counted_bars;
   
     
 
   while(
pos>=0)
     {
         
ExtMapBuffer1[pos] = iMA(NULL,0,8,0,MODE_EMA,PRICE_CLOSE,pos);
         
ExtMapBuffer2[pos] = iMA(NULL,0,13,0,MODE_EMA,PRICE_CLOSE,0);
         
pos--;
     }
     
     
string direction;   
     Print(
Crossed (ExtMapBuffer1[0],ExtMapBuffer2[0],direction));
      
 
//----
   
return(0);
  }
//+------------------------------------------------------------------+ 
3) Comment in the left corner;

This line of code will print a comment on the top left corner of the main window:

PHP Code:
Comment("Hi! I'm here on the main chart windows!"); 
I hope I helped!
CODERS'GURU:

Is that possible to hv different sounds on alerts creates by EA, than those ones created by indicators??? and moreover, is that possible to hv different sounds btwn indicator alerts??? mny tks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 11-21-2005, 12:19 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow Yes!

Quote:
Originally Posted by hua
CODERS'GURU:

Is that possible to hv different sounds on alerts creates by EA, than those ones created by indicators??? and moreover, is that possible to hv different sounds btwn indicator alerts??? mny tks in advance.
hua,
Happy to hear you again.

YES, we can have different sounds.
Tell me exactly what do you want to do and I'll program it for you
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 11-21-2005, 01:09 PM
hua hua is offline
Member
 
Join Date: Oct 2005
Location: Athens
Posts: 75
hua is on a distinguished road
Quote:
Originally Posted by codersguru
hua,
Happy to hear you again.

YES, we can have different sounds.
Tell me exactly what do you want to do and I'll program it for you
OK SIR, The most important. 1) EA alerts to hv different sound than those ones in indicator alerts and 2) Different sounds between indicators alerts.

All i am trying to say, is to avoid traders to be always infront their screen. IE if they/we can hv different sounds on various alerts, according to each trader subjective importance, then we can make our life easier. tks vm indeed in advance.
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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/357-alerts.html
Posted By For Type Date
Diskussion - Daytrade the Forex für absolute Beginner - Seite 88 - Aktienboard.com This thread Refback 03-26-2008 03:41 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Got the alerts, now we need to find the system bottomdollar Suggestions for Trading Systems 5 04-26-2007 01:06 PM
need Stochs with alerts :) mwbro Indicators - Metatrader 4 4 12-05-2006 04:50 PM
E-mailing Alerts randallbowles General Discussion 2 05-01-2006 12:04 AM
Stochastic With Alerts guibernaua Suggestions for Trading Systems 9 03-11-2006 03:33 PM
Alerts hua Metatrader 4 2