William Tapia Diaz / Perfil
- Informações
9+ anos
experiência
|
0
produtos
|
0
versão demo
|
0
trabalhos
|
0
sinais
|
0
assinantes
|
William Tapia Diaz
To whom have purchased TrendLine Drawing with Angles Calculation, here goes the mql4 codes in order to get the angles values:
First: We have to get the trendlines names:
We use a new variable:
int indicatorName;
If:
indicatorForSwingCalculation=RSI ==> indicatorName=1
indicatorForSwingCalculation=AC ==> indicatorName=2
indicatorForSwingCalculation=AO ==> indicatorName=3
indicatorForSwingCalculation=ZigZag ==> indicatorName=4
(Being "indicatorForSwingCalculation" an input when indicator is started)
Then we get the name of Resistance and Support lines:
resistanceName="Resistance-"+(string)(int) indicatorName +"-"+(string)(int)period;
supportName="Support-"+(string)(int) indicatorName +"-"+(string)(int)period;
(Being "period" an input when indicator is started)
//////
Second: We get the angles value with next codes:
For Resistance Line:
We create a new variable:
string completeDescription=ObjectGetString(0, resistanceName,OBJPROP_TEXT,0);
Create another variable for store the angle value in string (obviously you can get the double immediately):
string angleStr=StringSubstr(completeDescription,StringFind(completeDescription,"Angle: ",0)+7,(StringFind(completeDescription," º",0))-(StringFind(completeDescription,"Angle: ",0)+7));
Finally:
double resistanceAngle=(double)angleStr;
--
For Support Line (the same thing but this time with the name of support line):
Create a new variable:
string completeDescription=ObjectGetString(0, supportName,OBJPROP_TEXT,0);
Create another variable for store the angle value in string (obviously you can get the double immediately):
string angleStr=StringSubstr(completeDescription,StringFind(completeDescription,"Angle: ",0)+7,(StringFind(completeDescription," º",0))-(StringFind(completeDescription,"Angle: ",0)+7));
Finally:
double supportAngle=(double)angleStr;
First: We have to get the trendlines names:
We use a new variable:
int indicatorName;
If:
indicatorForSwingCalculation=RSI ==> indicatorName=1
indicatorForSwingCalculation=AC ==> indicatorName=2
indicatorForSwingCalculation=AO ==> indicatorName=3
indicatorForSwingCalculation=ZigZag ==> indicatorName=4
(Being "indicatorForSwingCalculation" an input when indicator is started)
Then we get the name of Resistance and Support lines:
resistanceName="Resistance-"+(string)(int) indicatorName +"-"+(string)(int)period;
supportName="Support-"+(string)(int) indicatorName +"-"+(string)(int)period;
(Being "period" an input when indicator is started)
//////
Second: We get the angles value with next codes:
For Resistance Line:
We create a new variable:
string completeDescription=ObjectGetString(0, resistanceName,OBJPROP_TEXT,0);
Create another variable for store the angle value in string (obviously you can get the double immediately):
string angleStr=StringSubstr(completeDescription,StringFind(completeDescription,"Angle: ",0)+7,(StringFind(completeDescription," º",0))-(StringFind(completeDescription,"Angle: ",0)+7));
Finally:
double resistanceAngle=(double)angleStr;
--
For Support Line (the same thing but this time with the name of support line):
Create a new variable:
string completeDescription=ObjectGetString(0, supportName,OBJPROP_TEXT,0);
Create another variable for store the angle value in string (obviously you can get the double immediately):
string angleStr=StringSubstr(completeDescription,StringFind(completeDescription,"Angle: ",0)+7,(StringFind(completeDescription," º",0))-(StringFind(completeDescription,"Angle: ",0)+7));
Finally:
double supportAngle=(double)angleStr;
: