Download MetaTrader 5

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

To add comments, please log in or register
Rock-Trader.com
197
Rohit Sharma  

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  
what is written in the expert/journal tab
Keith Watford
Moderator
10641
Keith Watford  
   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
15735
whroeder1  
int counted == IndicatorCounted();
if( counted < LOOKBACK) counted = LOOKBACK;
for(int i = Bars - 1 - counted; i >= 0; --i){
   :
Rock-Trader.com
197
Rohit Sharma  
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  
and what is written in the expert tab
Rock-Trader.com
197
Rohit Sharma  
qjol:
and what is written in the expert tab



error Expert

qjol
3243
qjol  

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  
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  
WHRoeder:



Could you please provide me the Full code, sir ?

Thanks

Alex

Keith Watford
Moderator
10641
Keith Watford  
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