Forex



Go Back   Forex Trading > Training > Metatrader > 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
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-03-2006, 05:32 PM
camisa's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Portugal
Posts: 348
camisa is on a distinguished road
How to alert only at candle close

Hi, can someone tell me the code so the simple example indicator I attach only issues an alert after the close of the candle if the signal stays valid and not keep alerting during the duration of the candle???

Thanks!
Attached Files
File Type: mq4 Alerta.mq4 (3.0 KB, 120 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 05-03-2006, 06:19 PM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 388
elihayun is on a distinguished road
Quote:
Originally Posted by camisa
Hi, can someone tell me the code so the simple example indicator I attach only issues an alert after the close of the candle if the signal stays valid and not keep alerting during the duration of the candle???

Thanks!
The idea is to find out if there is a new bar. we can doing that by comparing the current bar time with a time that we save.
here is the code for this routine


bool NewBar()
{
static datetime dt = 0;
if (Time[0] != dt)
{
dt = Time[0];
return(true);
}

return(false);
}


Now before we check our condition we can check if the bar has changed. Something like that


i=Bars-counted_bars; // your original line of code

if (!NewBar()) // Check if new bar occurs
return(0);

while(i>=0) // your original line of code
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 05-05-2006, 12:04 PM
camisa's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Portugal
Posts: 348
camisa is on a distinguished road
thanks a lot for the code!!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 04:50 PM
Junior Member
 
Join Date: Feb 2006
Posts: 8
jayzee is on a distinguished road
Is it possible to alert when closed price >= X value

Hi ,

Let say on 1 hour chart,
Is it possible to do a alert when closed price >= X value .
Is there any existing indicator that do such function?

Last edited by jayzee; 04-16-2008 at 04:53 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 04-16-2008, 05:02 PM
Junior Member
 
Join Date: Feb 2006
Posts: 8
jayzee is on a distinguished road
Hello,

Would you mind post the new .mq4 with the modified code?

*sorry, i am still learning *
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 04-16-2008, 05:09 PM
Administrator
 
Join Date: Sep 2005
Posts: 20,017
Blog Entries: 235
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
I moved your post to this thread - some indicator was posted and may be it is what you are looking for.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
candle, CANDLE CLOSE ALERT

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
Questions: to start with MetaTrader and forex Maji General Discussion 476 11-02-2009 03:47 PM
4H Candle Close Indicator capamando Indicators - Metatrader 4 13 10-28-2009 12:46 PM
Open/close trade on same bar's close? WNW Expert Advisors - Metatrader 4 2 03-29-2007 06:37 AM


All times are GMT. The time now is 02:19 AM.



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