Download MetaTrader 5

Urgent Help Need, My Indicator not Working In Some Other Broker Terminal

To add comments, please log in or register
Unable to find the answer to your question? Use the search!
Rock-Trader.com
197
Rohit Sharma 2014.05.07 17:47 

Dear Traders,

I have created a Custom Indicator which works based on few other custom indicator,

But when I add this Indicator with price chart the signal comes, but when the live market runs signal doesn't comes,

If we change the time frame the indicator signal disappear from the price chart,(again I wanted to add the indicator),

Please help me I couldn't solve this issue,

Thanks in advance

Arun Alaxander

qjol
3243
qjol 2014.05.07 17:55  
what is written in the expert/journal tab
Keith Watford
Moderator
9650
Keith Watford 2014.05.07 21:42  
   i=Bars-Counted_bars;           // Index of the first uncounted

When Counted_bars==0, i will be out of range.

ie. if there are 100 bars on the chart, this will calculate as 100-0, equals 100.

But the chart bars are indexed 0 to 99, so anything that tries to calculate with bar index [100+] will result in "Array out of range"

Curiously, this doesn't seem to matter with iCustom calls, as they return 0.00 instead of an Error.

Also "Array out of range" doesn't always result in a critical error. It does seem to if changing time-frames though.

Make sure that if Counted_bars==0 you reduce i by an amount that will more than cover any possible look back in the code.

whroeder1
14532
whroeder1 2014.05.08 00:38  
int counted == IndicatorCounted();
if( counted < LOOKBACK) counted = LOOKBACK;
for(int i = Bars - 1 - counted; i >= 0; --i){
   :
Rock-Trader.com
197
Rohit Sharma 2014.05.08 01:10  
qjol:
what is written in the expert/journal tab



when I change the Time Frame Lower to Higher I get come comments in Journal tab,

Commenta in Journal

qjol
3243
qjol 2014.05.08 08:46  
and what is written in the expert tab
Rock-Trader.com
197
Rohit Sharma 2014.05.08 16:25  
qjol:
and what is written in the expert tab



error Expert

qjol
3243
qjol 2014.05.08 16:34  

you got your problem in front of you

it's array out of range in line 88 column 33

Rock-Trader.com
197
Rohit Sharma 2014.05.08 16:39  
GumRai:

When Counted_bars==0, i will be out of range.

ie. if there are 100 bars on the chart, this will calculate as 100-0, equals 100.

But the chart bars are indexed 0 to 99, so anything that tries to calculate with bar index [100+] will result in "Array out of range"

Curiously, this doesn't seem to matter with iCustom calls, as they return 0.00 instead of an Error.

Also "Array out of range" doesn't always result in a critical error. It does seem to if changing time-frames though.

Make sure that if Counted_bars==0 you reduce i by an amount that will more than cover any possible look back in the code.



Could you Please Provide me the code, which should I replace ? I have Posted the pic off error I getting in Journel and Experts .

Please help me sir.


Thank You

Alex

Rock-Trader.com
197
Rohit Sharma 2014.05.08 16:41  
WHRoeder:



Could you please provide me the Full code, sir ?

Thanks

Alex

Keith Watford
Moderator
9650
Keith Watford 2014.05.08 20:03  
Rock-Trader:



Could you Please Provide me the code, which should I replace ? I have Posted the pic off error I getting in Journel and Experts .

Please help me sir.


Thank You

Alex


Well, you use [i+1] in your code and for some strange reason, you decided to name the period in the iATR call "Magic_Value"

Try something like this

   Counted_bars=IndicatorCounted(); // Number of counted bars
   if(Counted_bars<0)return(-1);
   int startbar=1+1+Magic_Value;
   if(Counted_bars<startbar)
      Counted_bars=startbar;
   i=Bars-Counted_bars;           // Index of the first uncounted
12
To add comments, please log in or register