Price Data Components
Indicators Used
0
Views
0
Downloads
0
Favorites
ninetfmovement
//+------------------------------------------------------------------+
//| NineTFMovement.mq4 |
//| Copyright 2014, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014 - By 3RJ ~ Roy Philips-Jacobs ~ 27/11/2014"
#property link "http://www.mql5.com"
#property link "http://www.gol2you.com ~ Forex Videos"
#property version "1.00"
//---
#property indicator_separate_window
//--
extern string NineTFMovement="Copyright © 2014 By 3RJ ~ Roy Philips-Jacobs";
//--
//--- spacing
int scaleX=60,scaleY=40,scaleYt=18,offsetX=250,offsetY=3,fontSize=9; // coordinate
double scaleXp=45;
double scaleYp=29;
//--- arrays for various things
int TF[]={1,5,15,30,60,240,1440,10080,43200};
int xx;
int wp=56;
int ndigs=0;
double er;
double digs;
//--
string periodStr[] = {" M1"," M5","M15","M30"," H1"," H4"," D1"," W1","MN1"}; // Text Timeframes
string labelNameStr[] = {"TIMEFRAMES","PRICEMOVEMENT","HIGHLOWRANGE"}; // Indicator labels
//--
string CRight;
string symbol;
//--
void EventSetTimer();
//---
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
symbol=_Symbol;
CRight="Copyright © 2014 By 3RJ ~ Roy Philips-Jacobs";
//--
//---- indicators
//--
IndicatorShortName("NineTFMovement ("+symbol+")");
//--
IndicatorDigits(Digits);
//----
// Checking the Digits Point
digs=Digits;
if (digs==3 || digs==5)
{er=Point*10; ndigs=1; xx=10;}
else {er=Point; ndigs=0; xx=1;}
//---
return(INIT_SUCCEEDED);
}
//----
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
//----
void OnDeinit(const int reason)
{
//----
EventKillTimer();
GlobalVariablesDeleteAll();
//--
int x=0,y=0,yy=0;
for(x=0;x<9;x++)
{ObjectDelete("txPeriod"+x);}
for(y=0;y<3;y++)
{ObjectDelete("txLabel"+y);}
for(y=0;y<4;y++)
{ObjectDelete("txTime"+y);}
//y=0;
ObjectDelete("txCons"+"3");
ObjectDelete("txCons"+"3"+"a");
ObjectDelete("txCons"+"3"+"a"+"1");
for(x=0;x<9;x++)
{ObjectDelete("barMove"+x);}
for(x=0;x<9;x++)
{ObjectDelete("txPips"+x);}
//--
//----
return;
}
//----
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
//----
int start()
{
//----
if(NineTFMovement!=CRight) return(0);
//--- Set Last error value to Zero
ResetLastError();
ChartSetInteger(0,CHART_AUTOSCROLL,0,true);
WindowRedraw();
ChartRedraw(0);
Sleep(500);
RefreshRates();
int w,x,y;
int ocB,ocS;
int ntf=WindowFirstVisibleBar();
//---
RefreshRates();
string hr=StringSubstr(TimeToStr(TimeCurrent(),TIME_MINUTES),0,2);
string mi=StringSubstr(TimeToStr(TimeCurrent(),TIME_MINUTES),3,2);
string sc=StringSubstr(TimeToStr(TimeCurrent(),TIME_SECONDS),6,2);
string tztxt;
int tcurr=TimeHour(TimeCurrent()); // Server Time == GMT+2 == (05:00 AM WIB-Jakarta Time)
if (tcurr==23) {tztxt="NYC/NZD";} // 04 WIB -> (23+5-24= 04:00 AM WIB -> Server Time + 5 Hours = WIB or Jakarta Time)
if (tcurr==0) {tztxt="NZD";} // 05 WIB
if (tcurr==1) {tztxt="NZD/AUS";} // 06 WIB
if (tcurr>=2 && tcurr<=4) {tztxt="NZD/AUS/TOK";} // 07 -> <= 09 WIB
if (tcurr>=5 && tcurr<=8) {tztxt="AUS/TOK";} // 10 -> <= 13 WIB
if (tcurr>=9 && tcurr<=10) {tztxt="AUS/TOK/LON";} // 14 -> <= 15 WIB
if (tcurr>=11 && tcurr<=13) {tztxt="LON";} // 16 -> <= 18 WIB
if (tcurr>=14 && tcurr<=18) {tztxt="LON/NYC";} // 19 -> <= 23 WIB
if (tcurr>=19 && tcurr<=22) {tztxt="NYC";} // 24(00) -> <= 03 WIB
//--
//--- create timeframe text labels
//--
for(x=0;x<9;x++)
{
ObjectCreate(0,"txPeriod"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txPeriod"+x,periodStr[x],fontSize,"Bodoni MT Black",clrGold);
ObjectSetInteger(0,"txPeriod"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txPeriod"+x,OBJPROP_XDISTANCE,scaleXp+x*scaleX+offsetX);
ObjectSetInteger(0,"txPeriod"+x,OBJPROP_YDISTANCE,y*scaleY+offsetY+7);
}
//--
//--- create indicator labels time
ObjectCreate(0,"txTime"+"0",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txTime"+"0",StringConcatenate("H: ",hr),11,"Arial Bold",clrGold);
ObjectSetInteger(0,"txTime"+"0",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txTime"+"0",OBJPROP_XDISTANCE,offsetX-230);
ObjectSetInteger(0,"txTime"+"0",OBJPROP_YDISTANCE,0*scaleYt+offsetY+scaleYp);
//--
ObjectCreate(0,"txTime"+"1",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txTime"+"1",StringConcatenate("M: ",mi),11,"Arial Bold",clrGold);
ObjectSetInteger(0,"txTime"+"1",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txTime"+"1",OBJPROP_XDISTANCE,offsetX-232);
ObjectSetInteger(0,"txTime"+"1",OBJPROP_YDISTANCE,1*scaleYt+offsetY+scaleYp);
//--
ObjectCreate(0,"txTime"+"2",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txTime"+"2",StringConcatenate("S: ",sc),11,"Arial Bold",clrGold);
ObjectSetInteger(0,"txTime"+"2",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txTime"+"2",OBJPROP_XDISTANCE,offsetX-229);
ObjectSetInteger(0,"txTime"+"2",OBJPROP_YDISTANCE,2*scaleYt+offsetY+scaleYp);
//--
ObjectCreate(0,"txTime"+"3",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txTime"+"3",StringConcatenate("EST TZ: ",tztxt),8,"Arial Bold",clrGold);
ObjectSetInteger(0,"txTime"+"3",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txTime"+"3",OBJPROP_XDISTANCE,offsetX-243);
ObjectSetInteger(0,"txTime"+"3",OBJPROP_YDISTANCE,3*scaleYt+offsetY+35);
//--
//--- create indicator arrow trend consideration
RefreshRates();
ObjectDelete("txCons"+"3");
ObjectDelete("txCons"+"3"+"a");
ObjectDelete("txCons"+"3"+"a"+"1");
//--
double Wpr[];
double MAOnL[];
double MAOnW[];
ArrayResize(Wpr,ntf);
ArrayResize(MAOnL,ntf);
ArrayResize(MAOnW,ntf);
ArraySetAsSeries(Wpr,true);
ArraySetAsSeries(MAOnL,true);
ArraySetAsSeries(MAOnW,true);
double doppr=iOpen(symbol,TF[6],0);
double divcl15=iClose(symbol,TF[2],0);
for(w=ntf-1;w>=0;w--) {Wpr[w]=iWPR(symbol,TF[2],wp,w);}
MAOnL[0]=MathAbs(iMAOnArray(Wpr,0,5,0,3,0));
MAOnL[1]=MathAbs(iMAOnArray(Wpr,0,5,0,3,1));
MAOnW[0]=MathAbs(iMAOnArray(MAOnL,0,10,0,3,0));
MAOnW[1]=MathAbs(iMAOnArray(MAOnL,0,10,0,3,1));
double divdhl1=MAOnL[0]-MAOnW[0];
double divdhl0=MAOnL[1]-MAOnW[1];
//--
for(x=0;x<3;x++)
{
if(iClose(symbol,TF[x],0)>iOpen(symbol,TF[x],0))
{ocB++;}
if(iClose(symbol,TF[x],0)<iOpen(symbol,TF[x],0))
{ocS++;}
}
//--
bool BCons=ocB>ocS;
bool SCons=ocB<ocS;
if(ocB==3) {bool up15=true;}
if(ocS==3) {bool dn15=true;}
//--
if((divcl15>doppr) && (divdhl0>divdhl1) && (BCons))
{
//--
ObjectDelete("txCons"+x);
ObjectDelete("txCons"+x+"a");
ObjectDelete("txCons"+x+"a"+"1");
//--
ObjectCreate(0,"txCons"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x,CharToStr(164),25,"Wingdings",clrLime);
ObjectSetInteger(0,"txCons"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x,OBJPROP_XDISTANCE,offsetX-172);
ObjectSetInteger(0,"txCons"+x,OBJPROP_YDISTANCE,1*scaleYt+offsetY+19);
//--
ObjectCreate(0,"txCons"+x+"a",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a",CharToStr(217),18,"Wingdings",clrLime);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_XDISTANCE,offsetX-168);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_YDISTANCE,0*scaleYt+offsetY+24);
//--
if((BCons)&&(up15))
{
ObjectCreate(0,"txCons"+x+"a"+"1",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a"+"1","UP",6,"Bodoni MT Black",clrYellow);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_XDISTANCE,offsetX-164);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_YDISTANCE,2*scaleYt+offsetY+33);
}
//--
else
{
ObjectCreate(0,"txCons"+x+"a"+"1",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a"+"1","HOLD",6,"Bodoni MT Black",clrYellow);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_XDISTANCE,offsetX-171);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_YDISTANCE,2*scaleYt+offsetY+33);
}
}
//--
//--
if((divcl15<doppr) && (divdhl0>divdhl1) && (BCons))
{
//--
ObjectDelete("txCons"+x);
ObjectDelete("txCons"+x+"a");
ObjectDelete("txCons"+x+"a"+"1");
//--
ObjectCreate(0,"txCons"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x,CharToStr(164),25,"Wingdings",clrRed);
ObjectSetInteger(0,"txCons"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x,OBJPROP_XDISTANCE,offsetX-172);
ObjectSetInteger(0,"txCons"+x,OBJPROP_YDISTANCE,1*scaleYt+offsetY+19);
//--
ObjectCreate(0,"txCons"+x+"a",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a",CharToStr(217),18,"Wingdings",clrLime);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_XDISTANCE,offsetX-168);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_YDISTANCE,0*scaleYt+offsetY+24);
//--
if((BCons)&&(up15))
{
ObjectCreate(0,"txCons"+x+"a"+"1",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a"+"1","UP",6,"Bodoni MT Black",clrYellow);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_XDISTANCE,offsetX-164);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_YDISTANCE,2*scaleYt+offsetY+33);
}
//--
else
{
ObjectCreate(0,"txCons"+x+"a"+"1",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a"+"1","HOLD",6,"Bodoni MT Black",clrYellow);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_XDISTANCE,offsetX-171);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_YDISTANCE,2*scaleYt+offsetY+33);
}
}
//--
//--
if((divcl15<doppr) && (divdhl0>divdhl1) && (SCons))
{
//--
ObjectDelete("txCons"+x);
ObjectDelete("txCons"+x+"a");
ObjectDelete("txCons"+x+"a"+"1");
//--
ObjectCreate(0,"txCons"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x,CharToStr(164),25,"Wingdings",clrLime);
ObjectSetInteger(0,"txCons"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x,OBJPROP_XDISTANCE,offsetX-172);
ObjectSetInteger(0,"txCons"+x,OBJPROP_YDISTANCE,1*scaleYt+offsetY+19);
//--
ObjectCreate(0,"txCons"+x+"a",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a",CharToStr(218),18,"Wingdings",clrRed);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_XDISTANCE,offsetX-168);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_YDISTANCE,2*scaleYt+offsetY+22);
//--
if((SCons)&&(dn15))
{
ObjectCreate(0,"txCons"+x+"a"+"1",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a"+"1","DOWN",6,"Bodoni MT Black",clrYellow);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_XDISTANCE,offsetX-171);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_YDISTANCE,0*scaleYt+offsetY+31);
}
//--
else
{
ObjectCreate(0,"txCons"+x+"a"+"1",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a"+"1","HOLD",6,"Bodoni MT Black",clrYellow);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_XDISTANCE,offsetX-171);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_YDISTANCE,0*scaleYt+offsetY+31);
}
}
//--
//--
if((divcl15<doppr) && (divdhl0<divdhl1) && (SCons))
{
//--
ObjectDelete("txCons"+x);
ObjectDelete("txCons"+x+"a");
ObjectDelete("txCons"+x+"a"+"1");
//--
ObjectCreate(0,"txCons"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x,CharToStr(164),25,"Wingdings",clrRed);
ObjectSetInteger(0,"txCons"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x,OBJPROP_XDISTANCE,offsetX-172);
ObjectSetInteger(0,"txCons"+x,OBJPROP_YDISTANCE,1*scaleYt+offsetY+19);
//--
ObjectCreate(0,"txCons"+x+"a",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a",CharToStr(218),18,"Wingdings",clrRed);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_XDISTANCE,offsetX-168);
ObjectSetInteger(0,"txCons"+x+"a",OBJPROP_YDISTANCE,2*scaleYt+offsetY+22);
//--
if((SCons)&&(dn15))
{
ObjectCreate(0,"txCons"+x+"a"+"1",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a"+"1","DOWN",6,"Bodoni MT Black",clrYellow);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_XDISTANCE,offsetX-171);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_YDISTANCE,0*scaleYt+offsetY+31);
}
//--
else
{
ObjectCreate(0,"txCons"+x+"a"+"1",OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x+"a"+"1","HOLD",6,"Bodoni MT Black",clrYellow);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_XDISTANCE,offsetX-171);
ObjectSetInteger(0,"txCons"+x+"a"+"1",OBJPROP_YDISTANCE,0*scaleYt+offsetY+31);
}
}
//--
//--
else
{
//--
ObjectCreate(0,"txCons"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txCons"+x,CharToStr(164),25,"Wingdings",clrYellow);
ObjectSetInteger(0,"txCons"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txCons"+x,OBJPROP_XDISTANCE,offsetX-172);
ObjectSetInteger(0,"txCons"+x,OBJPROP_YDISTANCE,1*scaleYt+offsetY+19);
//--
}
//--
//--- create indicator text labels
//--
for(y=0;y<3;y++)
{
ObjectCreate(0,"txLabel"+y,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txLabel"+y,labelNameStr[y],fontSize,"Bodoni MT Black",clrGold);
ObjectSetInteger(0,"txLabel"+y,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txLabel"+y,OBJPROP_XDISTANCE,offsetX-100);
ObjectSetInteger(0,"txLabel"+y,OBJPROP_YDISTANCE,y*scaleY+offsetY+7);
}
//--
//--- create arrow movement for each timeframes
RefreshRates();
for(x=0;x<9;x++)
{ObjectDelete("barMove"+x);}
//--
for(x=0;x<9;x++)
{
if(iClose(symbol,TF[x],0)>iOpen(symbol,TF[x],0))
{
//--
ObjectCreate(0,"barMove"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetString(0,"barMove"+x,OBJPROP_TEXT,CharToStr(217));
ObjectSetString(0,"barMove"+x,OBJPROP_FONT,"Wingdings");
ObjectSetInteger(0,"barMove"+x,OBJPROP_FONTSIZE,27);
ObjectSetInteger(0,"barMove"+x,OBJPROP_COLOR,clrBlue);
ObjectSetInteger(0,"barMove"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"barMove"+x,OBJPROP_XDISTANCE,scaleXp+x*scaleX+offsetX-3);
ObjectSetInteger(0,"barMove"+x,OBJPROP_YDISTANCE,1*scaleY+offsetY-3);
}
else if(iClose(symbol,TF[x],0)<iOpen(symbol,TF[x],0))
{
ObjectCreate(0,"barMove"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetString(0,"barMove"+x,OBJPROP_TEXT,CharToStr(218));
ObjectSetString(0,"barMove"+x,OBJPROP_FONT,"Wingdings");
ObjectSetInteger(0,"barMove"+x,OBJPROP_FONTSIZE,27);
ObjectSetInteger(0,"barMove"+x,OBJPROP_COLOR,clrWhite);
ObjectSetInteger(0,"barMove"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"barMove"+x,OBJPROP_XDISTANCE,scaleXp+x*scaleX+offsetX-3);
ObjectSetInteger(0,"barMove"+x,OBJPROP_YDISTANCE,1*scaleY+offsetY-3);
}
else
{
ObjectCreate(0,"barMove"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetString(0,"barMove"+x,OBJPROP_TEXT,CharToStr(108));
ObjectSetString(0,"barMove"+x,OBJPROP_FONT,"Wingdings");
ObjectSetInteger(0,"barMove"+x,OBJPROP_FONTSIZE,27);
ObjectSetInteger(0,"barMove"+x,OBJPROP_COLOR,clrYellow);
ObjectSetInteger(0,"barMove"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"barMove"+x,OBJPROP_XDISTANCE,scaleXp+x*scaleX+offsetX-3);
ObjectSetInteger(0,"barMove"+x,OBJPROP_YDISTANCE,1*scaleY+offsetY-3);
}
}
//--
//--- create count of points range
//--
RefreshRates();
for(x=0;x<9;x++)
{
double hilo=iHigh(symbol,TF[x],0)-iLow(symbol,TF[x],0);
string tcent=DoubleToStr(NormalizeDouble((hilo/er)*xx,ndigs),ndigs);
if(ndigs==1)
{
if(StringLen(tcent)<=4) {double ltx=3.5-StringLen(tcent);}
else if(StringLen(tcent)==5) {ltx=4-StringLen(tcent);}
else {ltx=4.5-StringLen(tcent);}
}
else {ltx=3-StringLen(tcent);}
if(iClose(symbol,TF[x],0)>iOpen(symbol,TF[x],0))
{
ObjectCreate(0,"txPips"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txPips"+x,tcent,9,"Bodoni MT Black",clrBlue);
ObjectSetInteger(0,"txPips"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txPips"+x,OBJPROP_XDISTANCE,scaleXp+x*scaleX+offsetX+(ltx*4));
ObjectSetInteger(0,"txPips"+x,OBJPROP_YDISTANCE,2*scaleY+offsetY+7);
}
else if(iClose(symbol,TF[x],0)<iOpen(symbol,TF[x],0))
{
ObjectCreate(0,"txPips"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txPips"+x,tcent,9,"Bodoni MT Black",clrWhite);
ObjectSetInteger(0,"txPips"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txPips"+x,OBJPROP_XDISTANCE,scaleXp+x*scaleX+offsetX+(ltx*4));
ObjectSetInteger(0,"txPips"+x,OBJPROP_YDISTANCE,2*scaleY+offsetY+7);
}
else
{
ObjectCreate(0,"txPips"+x,OBJ_LABEL,WindowFind("NineTFMovement ("+symbol+")"),0,0);
ObjectSetText("txPips"+x,tcent,9,"Bodoni MT Black",clrYellow);
ObjectSetInteger(0,"txPips"+x,OBJPROP_CORNER,0);
ObjectSetInteger(0,"txPips"+x,OBJPROP_XDISTANCE,scaleXp+x*scaleX+offsetX+(ltx*4));
ObjectSetInteger(0,"txPips"+x,OBJPROP_YDISTANCE,2*scaleY+offsetY+7);
//--
}
}
//----
return(0);
//----
} //-end start()
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---