double per_cent[]; … per_cent[i] = leg * iATR(Symbol(),0,14,i);
Had you looked in Expert tab, you will see array exceeded.
Had you looked in Expert tab, you will see array exceeded.
Yes I noticed now, it seems there is a lot for me to understand before I can make this work.
I've tried many ways to overcome this, however even after I disabled "#property strict", My code is not working.
Would you mind providing some advice for the following two scenarios?
Scenario One: I have the following code, and the questions is, how come it wont plot open price? I tested few times and found that I can plot the open price once I replace the second last line as YYY[i] = open[i];
double YYY[];
double last_pivot[];
double reverse_range;
int OnInit()
{
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2,clrBlack);
SetIndexBuffer(0,YYY);
return(INIT_SUCCEEDED);
}
int OnCalculate package
{
int limit = rates_total - prev_calculated;
if(prev_calculated > 0)
limit++;
for (int i=limit-1; i>=0; i--) // (int i = 0; i < limit; i++) //(int i=limit-1; i>=0; i--)
{
last_pivot[i] = open[1];
reverse_range = last_pivot[i] ;
YYY[i] = last_pivot[i];
}
return(rates_total);
Scenario Two: if I want to have an array "last_pivot[i]" be calculated based on its last value "last_pivot[i+1]" will the following code work? if not how can make it work?
int OnCalculate package
{
int limit = rates_total - prev_calculated;
if(prev_calculated > 0)
limit++;
for (int i=limit-1; i>=0; i--) // (int i = 0; i < limit; i++) //(int i=limit-1; i>=0; i--)
{
last_pivot[i] = last_pivot[i+1] == NULL ? Open[i] : last_pivot[i+1] + 1 ; // if last_pivot[i+1] does not exist, "last_pivot[i] = open", otherwise "last_pivot[i] = last_pivot[i+1]"
Greatly appreciated
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
I have no programing background and have just started learning coding mt4 indicators.
I'm practicing with this indicator and have cleared all errors, but it is still not working.
Can anyone have a look for me. I should have made some rookie mistakes.
Greatly appreciated.
Keli