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 05-16-2006, 07:28 PM
aparsai's Avatar
Senior Member
 
Join Date: May 2006
Posts: 980
aparsai is on a distinguished road
Adding Histogram to a Chart

I was wondering how we can draw histogram on the chart or rather cover the candles with a specific colour. For example I'm trying to cover white candles with the green colour when the white candle is longer than 15 pips. Here is the code I've written and I don't know what's wrong with it. Any ideas?

//+------------------------------------------------------------------+
//| Colour_White.mq4 |
//+------------------------------------------------------------------+
#property copyright "Alireza Parsai"
#property link "http://www.cadpanel.com"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Green
//---- input parameters
extern double Span=15.0;
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM, 0, 2, Green);
SetIndexBuffer(0,ExtMapBuffer1);

//SetIndexDrawBegin(0,10);

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
if (counted_bars<0)
return(-1);
else counted_bars--;

int i=Bars-counted_bars;

while (i>=0)
{
double _close, _open, _difference;

_close=Close[i];
_open=Open[i];
_difference=_close-_open;

if ((_difference>0)&&(_difference>Span*Point))
{
ExtMapBuffer1[i]=_open;
Comment("Bar Lenght:",ExtMapBuffer1[i]);
}
else ExtMapBuffer1[i]=0.0;

i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+


Thanks in advance
__________________
Disclaimer: If you trade my EAs or systems or taking my advice including but not limited to selecting a broker, you are doing so at your own discretion. Forex is a risky business. You may lose substantial amount of money by taking the risk of live trading. I shall not be held responsible for your losses or problems of any kind with the broker.
PipBoxer.com / PBHelp.com / ForexBrace.com (Free MQL Training) / GridBoxer.com / Investatech.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-17-2006, 02:03 PM
aparsai's Avatar
Senior Member
 
Join Date: May 2006
Posts: 980
aparsai is on a distinguished road
Is there anybody out there to help me with this issue.
__________________
Disclaimer: If you trade my EAs or systems or taking my advice including but not limited to selecting a broker, you are doing so at your own discretion. Forex is a risky business. You may lose substantial amount of money by taking the risk of live trading. I shall not be held responsible for your losses or problems of any kind with the broker.
PipBoxer.com / PBHelp.com / ForexBrace.com (Free MQL Training) / GridBoxer.com / Investatech.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-07-2006, 05:56 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 400
iscuba11 is on a distinguished road
Red face

Does anybody want to help this guy??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-07-2006, 07:03 PM
raff1410's Avatar
Senior Member
 
Join Date: May 2006
Location: 24°10' E 54°24' N
Posts: 201
raff1410 is on a distinguished road
Quote:
Originally Posted by iscuba11
Does anybody want to help this guy??
Wait 5 min...

Raff
__________________
http://www.gummy-stuff.org/raff-regression.htm

http://www.try-your-luck.com/

Lost in action ;-)... just_raff1410[at]yahoo.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-07-2006, 07:13 PM
raff1410's Avatar
Senior Member
 
Join Date: May 2006
Location: 24°10' E 54°24' N
Posts: 201
raff1410 is on a distinguished road
Quote:
Originally Posted by raff1410
Wait 5 min...


Raff
if close-open > pips = yellow candle
if close-open < pips = blue candle

if HiLo = true then it repaint canle if high-low > or < pips

Raff
Attached Files
File Type: mq4 15pipsCandle.mq4 (2.7 KB, 50 views)
__________________
http://www.gummy-stuff.org/raff-regression.htm

http://www.try-your-luck.com/

Lost in action ;-)... just_raff1410[at]yahoo.com

Last edited by raff1410; 07-07-2006 at 07:51 PM.
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 Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RSI in Histogram MIG Indicators - Metatrader 4 54 08-04-2008 12:00 PM
Adding price to MA on chart techtrader Indicators - Metatrader 4 0 03-06-2007 09:06 PM
Adding moving average lines to chart Aaragorn Questions 1 07-14-2006 04:41 AM
Error adding EA to chart GoatT Expert Advisors - Metatrader 4 10 06-08-2006 12:59 AM


All times are GMT. The time now is 07:40 PM.



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