Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

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: 349
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: 396
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: 349
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,058
Blog Entries: 241
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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 488 11-17-2009 05:24 AM
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 01:06 PM.



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