Can anybody please help with iCustom to call an indicator. Anything wrong in my code? I allway get a value o.
this is my code using to call indicator
I have a similar problem where the EA returns ALWAYS a huge number like 2145672829290.0000000. BUT the custom indicator is plotted properly.
double RSI; RSI = iCustom(NULL, PERIOD_H1, "FXA0 - RSI Crossing 50 plus ATR ver1[1].2", 0.15, 21, 21, 2, 1); Comment("RSI :", RSI);Document what the call is, and test for an error
#define UP_RSI 0 #define DOWN_RSI 1 #define SELL 2 #define RSIx50 "FXA0 - RSI Crossing 50 plus ATR ver1[1].2" double ATR_Percent = 0.15; double RSI_Period = 21; double ATR_Period = 21; double RSI = iCustom(NULL, PERIOD_H1, RSIx50, ATR_Percent, RSI_Period, ATR_Period, SELL, 1); Comment("RSI :", RSI," Error=",GetLastError());
I have a similar problem where the EA returns ALWAYS a huge number like 2145672829290.0000000. BUT the custom indicator is plotted properly.
Unless an indicator uses SetIndexEmptyValue, the default for empty values (do not paint) is EMPTY_VALUE
EMPTY_VALUE 0x7FFFFFFF Default custom indicator empty value. 0x7FFFFFFF = 2147483647
Are you looking at the right buffer. Perhaps it is a multi-color indicator
Can anybody please help with iCustom to call an indicator. Anything wrong in my code? I allway get a value o.
this is my code using to call indicator
Hi myfuture,
Your indicator looks like it is producing the values ok.
You may want to try getting the current values and not the past values. In your example you have "1" as the past bar. Try "0" for the current bar.
Check your Data Window and place your mouse cursor on one of the red/blue arrows to confirm the data is there.
Also it helps to add more Print statements and Comments to track the values as they change.
Hope this helps,
Robert
I have a similar problem where the EA returns ALWAYS a huge number like 2145672829290.0000000. BUT the custom indicator is plotted properly.
WHRoeder explained the "EMPTY_BUFFER" for you and here is a way to use it.
Some indicators can produce signals at every tick.
Other indicators, like the RSI/ATR in the above post, only produce signals when certain conditions are met.
When the conditions are NOT met, the buffer shows "EMPTY_BUFFER" or the number "2147483647", which means the previous values were reset back to zero.You still can use this "EMPTY_BUFFER" information.
First turn the ""EMPTY_BUFFER" number "2147483647" value into zero (0)...
double Value1;
if (Value1 = 2147483647) Value1 = 0);
Then use it in your trade conditions:
if (Value1 = 0) Do Nothing;
if (Value1 > 0) Do Something; // Or... if Value1 = a specific value you are looking for (price, etc.), then do something.
Use the Print and Comments to show you the values, and look at the Data Window also.
If your indicator is plotting correctly, chances are the values are working fine, and you may have to slow down your testing to see them in the Data Window. That's why Print and Comments are so helpful.
Hope this helps,
Robert

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Can anybody please help with iCustom to call an indicator. Anything wrong in my code? I allway get a value o.
this is my code using to call indicator