Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Today's Posts


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 05-03-2006, 04:32 PM
camisa's Avatar
camisa camisa is offline
Senior Member
 
Join Date: Dec 2005
Location: Portugal
Posts: 222
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, 83 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-03-2006, 05:19 PM
elihayun's Avatar
elihayun elihayun is offline
Senior Member
 
Join Date: Jan 2006
Posts: 350
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!
Reply With Quote
  #3 (permalink)  
Old 05-05-2006, 11:04 AM
camisa's Avatar
camisa camisa is offline
Senior Member
 
Join Date: Dec 2005
Location: Portugal
Posts: 222
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!
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 03:50 PM
jayzee jayzee is offline
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 03:53 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-16-2008, 04:02 PM
jayzee jayzee is offline
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!
Reply With Quote
  #6 (permalink)  
Old 04-16-2008, 04:09 PM
newdigital newdigital is offline
Administrator
 
Join Date: Sep 2005
Posts: 15,222
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!
Reply With Quote
Reply



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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
4H Candle Close Indicator capamando Indicators - Metatrader 4 9 04-01-2008 09:21 PM
Open/close trade on same bar's close? WNW Expert Advisors - Metatrader 4 2 03-29-2007 05:37 AM
Advancing Charts Candle By Candle Maji Metatrader 4 0 02-27-2007 04:32 AM


All times are GMT. The time now is 10:58 PM.