If someone could help me with this code! Plz :D

 

Hi everyone, i must say that i'm not a coder, so this is one of my first attemp to make my own indicator, its based on rules wrote in other language but i wanted in mql4.
I attached the mql4 file if anyone could answer me whats wrong. For an unknown reason the code works fine till i try to calculate the EMA(ExtAverage, Line 216) of an array (ExtCal, Line 211) that was previously populated, and if the EMA can't be calculated then the next part of the indicator keeps in blank (ExtResult, Line 223). 

Hope someone could help me.

Files:
TEST1.mq4  19 kb
 
MarcoyLiss:


I attached the mql4 file if anyone could answer me whats wrong.

For an unknown reason the code works fine till i try to calculate the EMA(ExtAverage, Line 216) of an array (ExtCal, Line 211) that was previously populated,

  1. Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. bool      ExtParameters=false;
    :
       if(rates_total<=emaperiod || !ExtParameters)
       return(0);           // Line 200
    
    You never get to line 211, you return at 200.
 
William Roeder:
  1. Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. You never get to line 211, you return at 200.

Srry my mistake i will delete this.

Reason: