molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Wed May 29, 2024 6:14 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: histogram plots
PostPosted: Mon Jan 31, 2011 8:35 am 
Offline

Joined: Tue Dec 21, 2010 7:05 am
Posts: 3
Would someone please let me know how to create a histogram plot that is different in colour depending on the axis side

Example, the indicator gives a positive value resulting in histogram plotted bar above zero axis and coloured green, but when indicator gives a negative value, the histogram plotted bar is below the axis and a different colour, say red.

I think this distinction would be very useful if it is possible
thanks
dp


Top
 Profile  
 
 Post subject: Re: histogram plots
PostPosted: Mon Jan 31, 2011 10:20 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Try creating 2 signals (2 TI icons) with the same calculation (it may not work if you use advanced options live avg)
Use MathMax in one TI and MathMin in the second TI. Lets say your calculation is A+B.
Re write it as MathMax(A+B,0) and MathMin(A+B,0). MathMax and MathMin act as filters to show values >0 and <0 respectively.

Here MT4 documentation about it:

double MathMax( double value1, double value2)
Returns the maximum value of two numeric values.
Parameters:
value1 - The first numeric value.
value2 - The second numeric value.

Sample:
double result=MathMax(1.08,Bid);


double MathMin( double value1, double value2)
Returns the minimum value of two numeric values.
Parameters:
value1 - The first numeric value.
value2 - The second numeric value.

Sample:
double result=MathMin(1.08,Ask);

If you need the signals to be used with the strategy builder you don't need to use 2 TI and MathMax/MathMin, just comparing the indicator to zero (>0 or <0). You need 2 TI if you want to see the 2 signals.
There may be a work around, create on


Top
 Profile  
 
 Post subject: Re: histogram plots
PostPosted: Mon Jan 31, 2011 4:39 pm 
Offline

Joined: Tue Dec 21, 2010 7:05 am
Posts: 3
thank you!! , I will try this....and post outcome


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by Molanis © 2009