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.
normally i know how to call a indicator with icustom(),
but when i try to call LSMA trendindicator then it gives me back the value "1" all the time ,no madder what the trend really is now it returns allways one value.... "1".
so i thought that the 1 it returns is some kind of errorcheck that returns true or false.
but i need to know what the trend is and have to add some code to the indicator that gives me back the trendvalue not the errorcheckvalue.
and my question above means :what code to add to the indicator to get the trendvalue instead of errorcheck value back when i call it with icustom().
normally i know how to call a indicator with icustom(),
but when i try to call LSMA trendindicator then it gives me back the value "1" all the time ,no madder what the trend really is now it returns allways one value.... "1".
so i thought that the 1 it returns is some kind of errorcheck that returns true or false.
but i need to know what the trend is and have to add some code to the indicator that gives me back the trendvalue not the errorcheckvalue.
and my question above means :what code to add to the indicator to get the trendvalue instead of errorcheck value back when i call it with icustom().
greets homi
Hi homi,
I didn't misunderstand you. I gave you working example of iCustom.
Anyway. this is a line of code which will get the value of LSMA using iCustom.
Alert(iCustom(NULL,0,"LSMA in Color",14,1500,0,0));
parmeter 1 :the symbol - NULL for current symbol.
parmeter 2 : time frame - 0 for current time frame.
parmeter 3 : indicator name - here it's "LSMA in Color".
parmeter 4 : this is a setting for LSMA - Rperiod = 14.
parmeter 5 : this is a setting for LSMA - Draw4HowLongg = 1500.
parmeter 6 : the line number (range from 0 to 7) - usually used 0.
parmeter 7 : the working bar - 0 for the current bar.
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
Alert("Line3 on LSMA is: " + iCustom(NULL,0,"LSMA in Color",14,1500,2,0));
Alert("Line1 on LSMA is: " + iCustom(NULL,0,"LSMA in Color",14,1500,0,0));
Alert("Line2 on LSMA is: " + iCustom(NULL,0,"LSMA in Color",14,1500,1,0));
//Some mis-typed iCustom calls which will return:
//Wrong LSMA parameter
Alert("This is an error " + iCustom(NULL,0,"LSMA in Color",0,1500,0,0));
//Wrong line number
Alert("This is an error " + iCustom(NULL,0,"LSMA in Color",14,1500,3,0));
//Wrong Bar number
Alert("This is an error " + iCustom(NULL,0,"LSMA in Color",14,1500,3,counted_bars));
you say its an colorindicator what does that mean?
and the most important thing is how do i get the current state of it?
i allways get only wired number from it that looks like a rounded version of the closeprice in all three lines ,even with your unmodified demo ( indicator and demo).
what am i missing ?
how do i convert the output in a simple "green" "red" "yellow" string?
you say its an colorindicator what does that mean?
and the most important thing is how do i get the current state of it?
i allways get only wired number from it that looks like a rounded version of the closeprice in all three lines ,even with your unmodified demo ( indicator and demo).
what am i missing ?
how do i convert the output in a simple "green" "red" "yellow" string?
greets
stressed homi
Hi stressed homi
Did you try the demo and still getting wrong numbers?
Could you tell me the Alerts you've got? that's what I've got (2 minutes ago)
Line 1 Alert: is the value of the first buffer or LSMA (ExtMapBuffer1)
Line 2 Alert: is the value of the second buffer or LSMA (ExtMapBuffer2)
Line 3 Alert: is the value of the third buffer or LSMA (ExtMapBuffer3)
Then I wrote three iCustoms' calls with intentionally wrong parameters to show you what probably be wrong in your iCustom's call.
Could you tell me exactly what do you want to do? Maybe I can help!