Forex



Go Back   Forex Trading > Discussion Areas > Metatrader 4
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 03-03-2006, 09:11 PM
creative's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 162
creative is on a distinguished road
Lightbulb Easy or Hard to do?

Hi guys! I need one indicator that gives me a signal when one candle (bull or bear) cross the horizontal trendline. I don't know if this is difficult, but if not, could you please help me? Thanks in advance!

Cheers
Attached Images
File Type: gif Sem título.gif (36.6 KB, 129 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 03-03-2006, 10:53 PM
Mohammed's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 119
Mohammed is on a distinguished road
Lightbulb

Quote:
Originally Posted by creative
Hi guys! I need one indicator that gives me a signal when one candle (bull or bear) cross the horizontal trendline. I don't know if this is difficult, but if not, could you please help me? Thanks in advance!

Cheers
creative,
It's a very easy thing my friend.
Please try this code (save it as indicator) when the market opens.

PHP Code:
//+------------------------------------------------------------------+
//|                                                         Demo.mq4 |
//|                                                         Mohammed |
//+------------------------------------------------------------------+

#property indicator_chart_window

extern double Line_Price 0;
extern color clr Yellow;

int init()
{    
   
Draw_Horzintal_Line(Line_Price);
   return(
0);
}
int deinit()
{
      
int nobj ObjectsTotal();
      for (
int i=nobji>=0i--){
         
string objn ObjectName(i);
         if(
StringFind(objn"mhline"0) >= 0)
         
ObjectDelete(objn);}
  
   return(
0);
}
int start()
  {
/*-----
/ step 1: draw the horsintal line
/ step 2: alerts in crossing the line up and down
-----*/

if (High[0] < Line_Price && Low[0] > Line_Price)
Alert("Price crossed down");
if (
High[0] > Line_Price && Low[0] < Line_Price)
Alert("Price crossed up");
   return(
0);
  }
//+------------------------------------------------------------------+

void Draw_Horzintal_Line(double value)
   {
      
      
ObjectCreate("mhline"OBJ_HLINE00value);
      
ObjectSet("mhline"OBJPROP_COLORclr);
      
ObjectsRedraw();  
   } 
When you attach the indicator set the price level of the horzintal line and its color.

Enjoy
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 03-03-2006, 11:15 PM
creative's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 162
creative is on a distinguished road
Talking Very nice Mohammed

Mohammed i want to thank you for your reply , but i need to see the line on the chart before the candle cross. I want to have a visual, do you understand Mohammed?

Regards!
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 03-03-2006, 11:23 PM
Mohammed's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 119
Mohammed is on a distinguished road
Unhappy

Quote:
Originally Posted by creative
Mohammed i want to thank you for your reply , but i need to see the line on the chart before the candle cross. I want to have a visual, do you understand Mohammed?

Regards!
creative, Yes I know what do you want.

Just set the Line and wait the cross? Did I mis understand you?
You attach the indicator and set the line (very like you draw a normal line but with an indicator this time) and you wait the cross.

If the candle was down the line and crossed up it will alerts you up.
If the candle was up the line and crossed down it will alerts you down.

I hope it's what you want and sorry if it wasn't what you want.
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 03-03-2006, 11:30 PM
creative's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 162
creative is on a distinguished road
Quote:
Originally Posted by Mohammed
creative, Yes I know what do you want.

Just set the Line and wait the cross? Did I mis understand you?
You attach the indicator and set the line (very like you draw a normal line but with an indicator this time) and you wait the cross.

If the candle was down the line and crossed up it will alerts you up.
If the candle was up the line and crossed down it will alerts you down.

I hope it's what you want and sorry if it wasn't what you want.
Yes man that's exactly what i want ! I want to give you a big thanks for your precious help! All the best for you!

Last edited by creative; 03-03-2006 at 11:41 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
  #6 (permalink)  
Old 03-03-2006, 11:38 PM
Mohammed's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 119
Mohammed is on a distinguished road
Quote:
Originally Posted by creative
Yes man that's exactly what i want !
PS: Man i fixed the problem! I want to give you a big thanks for your precious help! All the best for you!
You're welcome ! I hope it works at Monday.
Attached Images
File Type: gif demo.gif (11.0 KB, 85 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
  #7 (permalink)  
Old 03-03-2006, 11:40 PM
creative's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 162
creative is on a distinguished road
But there is another problem, i can't plot two lines on the chart, just one.. can you fix please?
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
  #8 (permalink)  
Old 03-03-2006, 11:47 PM
creative's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 162
creative is on a distinguished road
Just want two...
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
  #9 (permalink)  
Old 03-03-2006, 11:48 PM
Mohammed's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 119
Mohammed is on a distinguished road
Arrow

Quote:
Originally Posted by creative
But there is another problem, i can't plot two lines on the chart, just one.. can you fix please?
No problem!
I'm working in it now !
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
  #10 (permalink)  
Old 03-03-2006, 11:57 PM
Mohammed's Avatar
Senior Member
 
Join Date: Mar 2006
Posts: 119
Mohammed is on a distinguished road
Cool

Here's the program!
Hope you like it!
Attached Images
File Type: gif demo2.gif (11.1 KB, 92 views)
Attached Files
File Type: mq4 HLines_Crossing.mq4 (1.6 KB, 57 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
Reply

Bookmarks


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
Running a program from MetaTrader is not a hard thing anymore! codersguru Tools and utilities 18 02-16-2009 12:23 PM
Easy question dwmcqueen Metatrader 4 1 04-14-2007 02:59 AM
Need Help with easy EMA!!!!! palexa Suggestions for Trading Systems 2 11-26-2006 03:45 AM
How hard to convert to Easy Language (Tradestation) srbtop General Discussion 1 01-17-2006 03:53 PM


All times are GMT. The time now is 09:25 AM.



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