Forex
Google

Go Back   Forex Trading > Discussion Areas > Setup Questions
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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 07-29-2006, 04:38 PM
FlatLine FlatLine is offline
Junior Member
 
Join Date: Apr 2006
Posts: 5
FlatLine is on a distinguished road
Help getting the color of a an indidator.

I am able to get the value of my indicator using:

double MyLevel=iCustom(NULL,0,"MyIndicator",0,0); // The current level

But i also need the color. I need to know if it is red or green. I have searched through this site and i haven't seen any code that will retreive the color of the indicator.

I did find this in the documentation.

color oldColor=ObjectGet("hline12", OBJPROP_COLOR);

But I couldn't figure out how to get my inidcator in there instead of hline12.
BTW, my idicator is in the main window.

Any help would be appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-29-2006, 05:35 PM
FX_Sniper's Avatar
FX_Sniper FX_Sniper is offline
Senior Member
 
Join Date: Jan 2006
Location: South Africa
Posts: 201
FX_Sniper is on a distinguished road
Why not use the same logic test that changes it's color in the main window in you indicator window ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-29-2006, 06:28 PM
FlatLine FlatLine is offline
Junior Member
 
Join Date: Apr 2006
Posts: 5
FlatLine is on a distinguished road
Because I've already done that and stored the value in the color. I con't want to roll through the history again and do the calculation each time I need to check the color.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-29-2006, 07:36 PM
DaytrSuccess DaytrSuccess is offline
Junior Member
 
Join Date: Jun 2006
Posts: 23
DaytrSuccess is on a distinguished road
indicator color

Quote:
Originally Posted by FlatLine
I am able to get the value of my indicator using:

double MyLevel=iCustom(NULL,0,"MyIndicator",0,0); // The current level

But i also need the color. I need to know if it is red or green. I have searched through this site and i haven't seen any code that will retreive the color of the indicator.

I did find this in the documentation.

color oldColor=ObjectGet("hline12", OBJPROP_COLOR);

But I couldn't figure out how to get my inidcator in there instead of hline12.
BTW, my idicator is in the main window.

Any help would be appreciated.
Maybe this is to simple : old color = indicator_color

Forgive me if this is inapropirate (i am a newbie) but I recently used that to comment on the color of my indicator in the main window.

would be happy if this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-30-2006, 08:39 AM
FX_Sniper's Avatar
FX_Sniper FX_Sniper is offline
Senior Member
 
Join Date: Jan 2006
Location: South Africa
Posts: 201
FX_Sniper is on a distinguished road
Quote:
Originally Posted by FlatLine
Because I've already done that and stored the value in the color. I con't want to roll through the history again and do the calculation each time I need to check the color.
Hmmm, I recon you could be helped faster if you are more detailed about what EXACTLY it is you are trying to accomplish, it is difficult to lend a hand but first having to use trail-&-error to figure out what it is you want let alone how to fix it. So I am sure that if we receive more details, someone would be glad to help you out
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 07-30-2006, 09:59 AM
beerhunter's Avatar
beerhunter beerhunter is offline
Member
 
Join Date: Nov 2005
Posts: 43
beerhunter is on a distinguished road
I'm not sure you can do that for iCustom. Multi-color indicators usually have multiple buffers, one buffer for each color, so instead of looking for color value look for buffer value, i.e.:

buffer1 is green, buffer2 is red. Usually, they are not diplayed at he same time, say when there is an uptrend, green is displayed, when downtrend, red is displayed. That means, when green has a given value, red is 0 or -1 or novalue.

So, if buffer1 is positive and buffer2 is 0 (buffer1>0 && buffer2<=0), you know there is a green color displayed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB 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
Stochastic Color Bar! turspedie Indicators - Metatrader 4 37 03-08-2008 03:00 PM
color change swall Metatrader 4 2 10-25-2006 11:41 PM
EMA in color european Indicators - Metatrader 4 9 09-18-2006 06:54 PM
Color Coded AMA? gabroo_munda Indicators - Metatrader 4 17 05-12-2006 04:42 PM


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