View Single Post
  #14 (permalink)  
Old 11-05-2006, 02:27 AM
mikejody mikejody is offline
Senior Member
 
Join Date: Dec 2005
Posts: 294
mikejody is on a distinguished road
OK, yes, that makes sense now; I am wondering if it would be possible for you to change the indicator to color the bar, instead of the indicator, when the conditions are met.

I am attaching a chart; I am wondering if you can color the 4th bar from the right green.

Do you see the long signal generated right before the 4th bar? It would be very good if the 4th bar itself could be colored green as an indicator to go long.

Is this possible to do?

Quote:
Originally Posted by codersguru
This is the code of changing the color of indicator:

PHP Code:
for(shift=limitshift>=0shift--)
   {
      if (
buffer[shift-1]>buffer[shift])
      {
         
UpBuffer[shift-1] = EMPTY_VALUE;
      }
      else if (
buffer[shift-1]<buffer[shift] )
      {
         
DownBuffer[shift-1] = EMPTY_VALUE;
      } 
      else
      {
         
UpBuffer[shift-1] = CLR_NONE;
         
DownBuffer[shift-1] = CLR_NONE;
      }
   } 
The code above means:
  • When the previous value of of Moving average is Greater than the current value change the color to red
  • And when the previous value of of Moving average is Lesser than the current value change the color to green
  • Or leave it yellow
That's all!
Attached Images
File Type: gif xpma1.gif (25.5 KB, 2052 views)
Reply With Quote