- Home
- Comunidad
- Programación
- Daily pivot
Edit Your Comment
Daily pivot
Miembro desde Nov 21, 2011
posts 1718
May 25, 2015 at 08:24
(editado May 25, 2015 at 08:26)
Miembro desde Nov 21, 2011
posts 1718
When you want to check the value... you print it:
Print('double Pivot= ',(Hi + Lo + Clo)/3);
Then you look at expert tab
Print('double Pivot= ',(Hi + Lo + Clo)/3);
Then you look at expert tab
May 27, 2015 at 17:34
Miembro desde Jul 27, 2010
posts 8
void CalculatePivotLines()
{
int bar = 1;
if ( TimeDayOfWeek(iTime(Symbol(), PERIOD_D1, bar)) == 0 ) bar = 2;
YsHigh = iHigh(Symbol(),PERIOD_D1,bar);
YsLow = iLow(Symbol(),PERIOD_D1,bar);
PP = ( YsHigh + YsLow + iClose(Symbol(),PERIOD_D1,bar) ) / 3 ;
R[0] = PP;
S[0] = PP;
R[1] = 2 * PP - YsLow;
R[2] = PP + YsHigh - YsLow;
R[3] = 2 * PP + YsHigh - 2 * YsLow;
S[1] = 2 * PP - YsHigh;
S[2] = PP + YsLow - YsHigh;
S[3] = 2 * PP + YsLow - 2 * YsHigh;
LWsHigh = iHigh(Symbol(),PERIOD_W1,1);
LWsLow = iLow(Symbol(),PERIOD_W1,1);
WPP = ( LWsHigh + LWsLow + iClose(Symbol(),PERIOD_W1,1) ) / 3 ;
WR[0] = WPP;
WS[0] = WPP;
WR[1] = 2 * WPP - LWsLow;
WR[2] = WPP + LWsHigh - YsLow;
WR[3] = 2 * WPP + LWsHigh - 2 * LWsLow;
WS[1] = 2 * WPP - LWsHigh;
WS[2] = WPP + LWsLow - LWsHigh;
WS[3] = 2 * WPP + LWsLow - 2 * LWsHigh;
}
void CalculateFiboLines()
{
F[0] = YsLow;
F[1] = YsLow + 0.236 * (YsHigh - YsLow);
F[2] = YsLow + 0.382 * (YsHigh - YsLow);
F[3] = YsLow + 0.500 * (YsHigh - YsLow);
F[4] = YsLow + 0.618 * (YsHigh - YsLow);
F[5] = YsHigh;
F[6] = YsLow + 1.618 * (YsHigh - YsLow);
F[7] = YsLow + 2.618 * (YsHigh - YsLow);
F[8] = YsLow + 4.236 * (YsHigh - YsLow);
F[9] = YsLow - 1.618 * (YsHigh - YsLow);
F[10] = YsLow - 2.618 * (YsHigh - YsLow);
F[11] = YsLow - 4.236 * (YsHigh - YsLow);
}
{
int bar = 1;
if ( TimeDayOfWeek(iTime(Symbol(), PERIOD_D1, bar)) == 0 ) bar = 2;
YsHigh = iHigh(Symbol(),PERIOD_D1,bar);
YsLow = iLow(Symbol(),PERIOD_D1,bar);
PP = ( YsHigh + YsLow + iClose(Symbol(),PERIOD_D1,bar) ) / 3 ;
R[0] = PP;
S[0] = PP;
R[1] = 2 * PP - YsLow;
R[2] = PP + YsHigh - YsLow;
R[3] = 2 * PP + YsHigh - 2 * YsLow;
S[1] = 2 * PP - YsHigh;
S[2] = PP + YsLow - YsHigh;
S[3] = 2 * PP + YsLow - 2 * YsHigh;
LWsHigh = iHigh(Symbol(),PERIOD_W1,1);
LWsLow = iLow(Symbol(),PERIOD_W1,1);
WPP = ( LWsHigh + LWsLow + iClose(Symbol(),PERIOD_W1,1) ) / 3 ;
WR[0] = WPP;
WS[0] = WPP;
WR[1] = 2 * WPP - LWsLow;
WR[2] = WPP + LWsHigh - YsLow;
WR[3] = 2 * WPP + LWsHigh - 2 * LWsLow;
WS[1] = 2 * WPP - LWsHigh;
WS[2] = WPP + LWsLow - LWsHigh;
WS[3] = 2 * WPP + LWsLow - 2 * LWsHigh;
}
void CalculateFiboLines()
{
F[0] = YsLow;
F[1] = YsLow + 0.236 * (YsHigh - YsLow);
F[2] = YsLow + 0.382 * (YsHigh - YsLow);
F[3] = YsLow + 0.500 * (YsHigh - YsLow);
F[4] = YsLow + 0.618 * (YsHigh - YsLow);
F[5] = YsHigh;
F[6] = YsLow + 1.618 * (YsHigh - YsLow);
F[7] = YsLow + 2.618 * (YsHigh - YsLow);
F[8] = YsLow + 4.236 * (YsHigh - YsLow);
F[9] = YsLow - 1.618 * (YsHigh - YsLow);
F[10] = YsLow - 2.618 * (YsHigh - YsLow);
F[11] = YsLow - 4.236 * (YsHigh - YsLow);
}
May 27, 2015 at 23:29
Miembro desde Sep 05, 2013
posts 50
FYI: MetaTrader has a page with lots of ready made code, you only have to search 'Pivot' : www.mql5.com/en/code/mt4
“Everybody should have a dream. What if that dream comes true?” – Jack Ma
*El uso comercial y el spam no serán tolerados y pueden resultar en el cierre de la cuenta.
Consejo: Al publicar una imagen o una URL de YouTube, ésta se integrará automáticamente en su mensaje!
Consejo: Escriba el signo @ para completar automáticamente un nombre de usuario que participa en esta discusión.