Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


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 03-03-2006, 08: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, 117 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-03-2006, 09: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!
Reply With Quote
  #3 (permalink)  
Old 03-03-2006, 10: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!
Reply With Quote
  #4 (permalink)  
Old 03-03-2006, 10: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!
Reply With Quote
  #5 (permalink)  
Old 03-03-2006, 10: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 10:41 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-03-2006, 10: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, 72 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-03-2006, 10: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!
Reply With Quote
  #8 (permalink)  
Old 03-03-2006, 10: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!
Reply With Quote
  #9 (permalink)  
Old 03-03-2006, 10: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!
Reply With Quote
  #10 (permalink)  
Old 03-03-2006, 10: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, 80 views)
Attached Files
File Type: mq4 HLines_Crossing.mq4 (1.6 KB, 51 views)
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 On
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 16 07-10-2008 12:06 PM
Easy question dwmcqueen Metatrader 4 1 04-14-2007 01:59 AM
Need Help with easy EMA!!!!! palexa Suggestions for Trading Systems 2 11-26-2006 02:45 AM
How hard to convert to Easy Language (Tradestation) srbtop General Discussion 1 01-17-2006 02:53 PM


All times are GMT. The time now is 07:05 AM.



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