Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
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.
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.
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.
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
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.