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

 

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

 
what is written in the expert/journal tab
 
   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.

 
int counted == IndicatorCounted();
if( counted < LOOKBACK) counted = LOOKBACK;
for(int i = Bars - 1 - counted; i >= 0; --i){
   :
 
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

 
and what is written in the expert tab
 
qjol:
and what is written in the expert tab



error Expert

 

you got your problem in front of you

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

 
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

 
WHRoeder:



Could you please provide me the Full code, sir ?

Thanks

Alex

 
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