Download MetaTrader 5
To add comments, please log in or register
Make screenshots in MetaTrader and manage them in the gallery!
Simmon4569
15
Simmon4569 2016.06.08 17:53 

Hello readers !!

Hope so that all are with a good health and wealth . This is my first time here. Hope so that i will learn something new .

Guys I am having a problem . I have attach an indicator and also its pic . It draws daily five lines . I want to know the indicator values at all those five lines so i use iCustom but

it only returns the value of white line not any other four because it was having only one buffer .

So i need help and want to learn that how can i get the values of rest four horizontal lines .

Hope so that some one can help me out .

Best Regards

Simmon4569

 

Files:
Fernando Carreiro
1439
Fernando Carreiro 2016.06.08 18:13  

Unfortunately, the lines produced by the indicator are graphical "Chart Objects" and not the normal indicator buffers/modes that can be accessed by "iCustom()".

So, you will not be able to use "iCustom()" and will have to keep track of the "Chart Objects" instead, which can be rather complicated.

I would suggest two possible better solutions:

  • Rewriting the Indicator to use multiple buffers instead of Objects to keep track of the values of the five lines instead, so that you will then be able to use "iCustom()".
  • Alternatively, you could simply re-use the logic or calculations behind the 5 lines, directly in you EA instead of using an Indicator.

However, since it seems you are a beginner with very little coding experience, both possible solutions may be too difficult for you to do, and in that case may I suggest maybe placing a "Job" request in the "Freelance" section.

Simmon4569
15
Simmon4569 2016.06.08 18:19  
FMIC:

Unfortunately, the lines produced by the indicator are graphical "Chart Objects" and not the normal indicator buffers/modes that can be accessed by "iCustom()".

So, you will not be able to use "iCustom()" and will have to keep track of the "Chart Objects" instead, which can be rather complicated.

I would suggest two possible better solutions:

  • Rewriting the Indicator to use multiple buffers instead of Objects to keep track of the values of the five lines instead, so that you will then be able to use "iCustom()".
  • Alternatively, you could simply re-use the logic or calculations behind the5 lines, directly in you EA instead of using an Indicator.

However, since it seems you are a beginner with very little coding experience, both possible solutions may be too difficult for you to do, and in that case may I suggest maybe placing a "Job" request in the "Freelance" section.

Thanks for replying

I would like to do practice on using the indicator logic in EA but i am armature so can u please explain me indicator logic on which it work not full just the main.

I should have posted it on Free lancer but right now i am out of money so can u please help me understanding its logic a little bit . 

Fernando Carreiro
1439
Fernando Carreiro 2016.06.08 18:33  
Simmon4569:

Thanks for replying

I would like to do practice on using the indicator logic in EA but i am armature so can u please explain me indicator logic on which it work not full just the main.

I should have posted it on Free lancer but right now i am out of money so can u please help me understanding its logic a little bit . 

Sorry, but I can only offer assistance with your own attempt at coding such an implementation. Teaching you to code it step-by-step, would be the same as coding it for you as a "Freelnace" job but for "free". Besides, the values practiced in the "Freelance" can be quite reasonable. I am sure that with a small budget of $20-$50 you could get that coded for you.

Alternatively, I would suggest you follow the tutorials in the "Book" section or look at the many examples in the "Code Base" section.

Simmon4569
15
Simmon4569 2016.06.08 18:40  
FMIC:

Sorry, but I can only offer assistance with your own attempt at coding such an implementation. Teaching you to code it step-by-step, would be the same as coding it for you as a "Freelnace" job but for "free". Besides, the values practiced in the "Freelance" can be quite reasonable. I am sure that with a small budget of $20-$50 you could get that coded for you.

Alternatively, I would suggest you follow the tutorials in the "Book" section or look at the many examples in the "Code Base" section.

Thanks for Offer !!

I am trying to do calculations as it was in indicator . And post it what ever i obtain.

Simmon4569
15
Simmon4569 2016.06.08 19:41  
Simmon4569:

Thanks for Offer !!

I am trying to do calculations as it was in indicator . And post it what ever i obtain.


Hey i tried the following calculation in the script but does not give me the same result .

Hope so that u will understand the problem causing different result or guide me if something is missing and to be included .

#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

//Price_Angle = MathMod(((MathSqrt(ny_close[shift])*180) -225), 360);   *****the formulae as used in the indicator
//double MathS_OP = MathSqrt(ny_close[shift]);                          *****the formulae as used in the indicator

void OnStart()
{
Angle_value();
GMT = GMT/10000;    // i use Gmt as it was having the same value of ny_close
if(price_angle >= 0  &&  price_angle <= 90 )                  // following are calculation as it was in the indicator with different names
{
twhite =  GMT/10000  ; 
torange=  ((Math_OP - (Factor_NO/2)) * (Math_OP - (Factor_NO/2)))/10000;
tlime =  ((Math_OP + (Factor_NO/2)) * (Math_OP + (Factor_NO/2)))/10000;
tblue=  ((Math_OP + (Factor_NO)  ) * (Math_OP + Factor_NO ))/10000 ;
tred  =  ((Math_OP - Factor_NO)  * (Math_OP  - Factor_NO))/10000;
}
if(price_angle >= 180 && price_angle  <= 270 )
{
 twhite =  GMT/10000  ; 
torange=  ((Math_OP - (Factor_NO/2)) * (Math_OP - (Factor_NO/2)))/10000;
tlime =  ((Math_OP + (Factor_NO/2)) * (Math_OP + (Factor_NO/2)))/10000;
tblue=  ((Math_OP + (Factor_NO)  ) * (Math_OP + Factor_NO ))/10000 ;
tred  =  ((Math_OP - Factor_NO)  * (Math_OP  - Factor_NO))/10000;
} 
if(price_angle >= 91 && price_angle < 180 )
{
twhite1 =   GMT/10000  ; 
torange1 =  ((Math_OP + (Factor_NO/2)) * (Math_OP + (Factor_NO/2)))/10000;
tlime1   =  ((Math_OP - (Factor_NO/2)) * (Math_OP - (Factor_NO/2)))/10000;
tblue1   =  ((Math_OP - (Factor_NO)  ) * (Math_OP - Factor_NO ))/10000 ;
tred1    =  ((Math_OP +  Factor_NO)    * (Math_OP + Factor_NO))/10000;
}
if(price_angle >= 271 && price_angle <= 360 )
{
twhite1 =   GMT/10000  ; 
torange1 =  ((Math_OP + (Factor_NO/2)) * (Math_OP + (Factor_NO/2)))/10000;
tlime1   =  ((Math_OP - (Factor_NO/2)) * (Math_OP - (Factor_NO/2)))/10000;
tblue1   =  ((Math_OP - (Factor_NO)  ) * (Math_OP - Factor_NO ))/10000 ;
tred1    =  ((Math_OP +  Factor_NO)    * (Math_OP + Factor_NO))/10000;
}

Alert("value of white " , NormalizeDouble(twhite,5 ));                         // alert for white line  
Alert("value of orange " ,NormalizeDouble(torange,5) );                        // alert for orange line
Alert("value of lime " , NormalizeDouble(tlime,5) );                           // alert for lime line
Alert("value of blue " , NormalizeDouble(tblue,5) );                           // alert for blue line
Alert("value of tred " ,NormalizeDouble(tred,5) );                             // alert for red line 
Alert("FACTOR_NO ++ == +++ === " , Factor_NO);
Alert("value of white1 " , NormalizeDouble(twhite1,5 ));
Alert("value of orange1 " ,NormalizeDouble(torange1,5) );
Alert("value of lime1 " , NormalizeDouble(tlime1,5) );
Alert("value of blue1 " , NormalizeDouble(tblue1,5) );
Alert("value of tred1 " ,NormalizeDouble(tred,5) );

  
}

double GMT = iCustom(NULL,0,"Forex-goile-mod-gmt",100,1,4,false,1,0,4,0,1);              // getting the value of ny_close
double price_angle = (MathMod((MathSqrt(GMT*180)-225),360));                             // calculating the price of price_angle as it was in the indi
double Math_OP = MathSqrt(GMT);                                                          // calculating the value for Math_OP

double twhite   ;
double tlime    ;
double tblue    ;
double torange  ;
double tred     ;

double twhite1  ;
double tlime1   ;
double tblue1   ;
double torange1 ;
double tred1    ;
 
double Correction_V  = 0 ;
double Correction_V1 = 0 ;
double Correction_V2 = 0 ;
double Corrected_Price_angle  = 0 ;
double Corrected_Price_angle1 = 0 ;
double Corrected_Price_angle2 = 0 ;
double Factor_NO  = 0 ;  
double Factor_NO1 = 0 ;
double Factor_NO2 = 0 ;


void Angle_value()                                          // getting the value of factor in the user definr function
{  
 if(price_angle >= 90)
  {
   Correction_V1 = NormalizeDouble((price_angle/90),0);
   Corrected_Price_angle1 = (price_angle/Correction_V1);
   Factor_NO1 = Corrected_Price_angle1/180 ;
  
   Correction_V  = Correction_V1 ;
   Corrected_Price_angle = Corrected_Price_angle1 ;
   Factor_NO = Factor_NO1 ;
  } 
 else
  {
   Correction_V2 = NormalizeDouble((90/price_angle),0);
   Corrected_Price_angle2 = (price_angle * Correction_V2);
   Factor_NO2 = Corrected_Price_angle2/180 ;
   
   Correction_V = Correction_V2 ;
   Corrected_Price_angle = Corrected_Price_angle2 ;
   Factor_NO = Factor_NO2 ;
  }
}  
Fernando Carreiro
1439
Fernando Carreiro 2016.06.08 20:00  

Sorry to say this but that code is just "jiberish"! It is neither an EA nor an Indicator nor a Script (well, maybe it could be classified as a Script). It is just one big mix-up mess of all things MQL!

You will just have to go back to basics and take your time and learn by first following the tutorials in the "Book" until you understand the coding structure of the 3 different types of programs - Scripts, Indicators and Expert Advisors.

After going through the "book", start by coding very simple things by building from the example code provided by MetaQuotes.

I know you are a beginner and you would like to learn, preferably from a Mentor or Couch, but I do not know of any site that teaches MQL step by step like in a course or school, especially not for free (I think).

You can maybe get someone to couch you one-on-one but you will probably have to pay them for that service.

PS! There is also this link that the user "WHRoeder" provides that supposedly has tutorials and lessons, but it may be quite old and outdated: http://www.forexmt4.com/_MT4_Tutorials/

Simmon4569
15
Simmon4569 2016.06.08 20:07  
FMIC:

Sorry to say this but that code is just "jiberish"! It is neither an EA nor an Indicator nor a Script (well, maybe it could be classified as a Script). It is just one big mix-up mess of all things MQL!

You will just have to go back to basics and take your time and learn by first following the tutorials in the "Book" until you understand the coding structure of the 3 different types of programs - Scripts, Indicators and Expert Advisors.

After going through the "book", start by coding very simple things by building from the example code provided by MetaQuotes.

I know you are a beginner and you would like to learn, preferably from a Mentor or Couch, but I do not know of any site that teaches MQL step by step like in a course or school, especially not for free (I think).

You can maybe get someone to couch you one-on-one but you will probably have to pay them for that service.

PS! There is also this link that the user "WHRoeder" provides that supposedly has tutorials and lessons, but it may be quite old and outdated: http://www.forexmt4.com/_MT4_Tutorials/

Thanks for advising me all ..

I have learn some of MQL4  basics.

But the only purpose i wrote all that code in script was to just check weather it was giving right value or wrong .

But it was giving me wrong values. 

/
To add comments, please log in or register