//+------------------------------------------------------------------+ gPd , ,^bgk
-x-
//| Sidus v.2 Entry Indicator.mq4 | W[Z[o+7pK ]9_gbQ
//| | $1zWQJd[- 8SpG/gl"
//| Ideas by Sidus | !>Q\Y`a,* U/'l "N[
//+------------------------------------------------------------------+ r[7*1'. p :G>w MMv&z
#property copyright "Sidus" >T0`( #Lm RP$u/x"b
#property link "" o^owv( ![Qi+xyc
,TB$D]u8 kNK0KL
#property indicator_chart_window "d}ey=$h4 .@): Uh
#property indicator_buffers 4 0XqxW\8_l mrr]{K
#property indicator_color1 Blue X2:23j< u<8b5An;
#property indicator_color2 Red DpT$19Q+ 2.WI".&y=
#property indicator_color3 Blue rQU6*f ?L\"qz%gP
#property indicator_color4 DodgerBlue L2~'Z'q .1TuHC\mC
;G3?Sa7+ |\dv$`_T
#include <WinUser32.mqh> MHye!T6fO\ >3p~>;9sc
//---- input parameters -%^'x&e )Zr\W3yWX
extern int FastEMA=14; \^RKb-6n ?fH1?Z\'K
extern int SlowEMA=21; lCl5#L9 K ,NmDc^
extern int RSIPeriod=17; kLU-4W5t vYm-$KQ"o
extern bool Alerts=false; |\G^:V[. 8!|vp7/
//---- buffers ;B[(~LCyT b9rQQS
double ExtMapBuffer1[]; G'PZ=+!XO/
i=\)[;U
double ExtMapBuffer2[]; C1UU v=| Eo2`Vr9g
double ExtMapBuffer3[]; B%MdJ D> OW#0$%f
double ExtMapBuffer4[]; DF4CB# EtzSaB*|
//double rsi_sig[]; O#=%t 7(]F+\A3
//---- variables Mb 4"bDBsl D(ItNMcKu
int sigCurrent=0; 4Yi kC lXTE#,XVf
int sigPrevious=0; R#^ku)0 m[xl)/e
double pipdiffCurrent=0; ~U"m"zpLP ;ZUj2WxE
double pipdiffPrevious=0; k)S1Zs~G {)"[_<
//+------------------------------------------------------------------+ Z}uY%] nfF$h}<o+
//| Custom indicator initialization function | j0; ~2W#G* OiQf=Uz\
//+------------------------------------------------------------------+ C:t>u.. s 4_Dqm
int init() rtJER?A _Z]l=5d
{ P|$n rb-ao\
//---- indicators 5+M,X kg P4Pc;8T@!
SetIndexStyle(0,DRAW_LINE); Jq &Hz$L| E#+2)Q
SetIndexBuffer(0,ExtMapBuffer1); BJux5Nh 73rme,
SetIndexStyle(1,DRAW_LINE,1,3); +Pl)E5W!=` _aevaWtEx
SetIndexBuffer(1,ExtMapBuffer2); mBErU6?X,A :@i+yN cV
SetIndexStyle(2,DRAW_ARROW,1,5); ~ps,U F2}Fuupb.
SetIndexArrow(2,233); (a_bU5) L"
ejA
SetIndexBuffer(2,ExtMapBuffer3); ; R+>}6 QIMd`c
SetIndexEmptyValue(2,0.0); Ih:Q}V#6 v_5qE
SetIndexStyle(3,DRAW_ARROW,1,5); i4|R0>b P^<3 Z)L
SetIndexArrow(3,234); ?2&= +QaT 1ARtFR2C{b
SetIndexBuffer(3,ExtMapBuffer4); G*N[tw ^ slIR!L
SetIndexEmptyValue(3,0.0); nv_vFK E7/UsUV.
//---- y-3'qq'E P?V+<c{
return(0); [bHm-X] Db Qp(W0
} P_5aHeiJ |iUF3s|?
//+------------------------------------------------------------------+ 'UsR/h5T 2?%*UxcO
//| Custom indicator deinitialization function | D@La-K*5 >bV3~m$a+
//+------------------------------------------------------------------+ 8s6[-F5 &'12,'8
int deinit() &b#d4p6&l .)tQ&2
{ 0;TiNrzg ub8d]GZJ
//---- )r46I$]> fGV'l__\\
r:V bjmL p+iNi4y@
//---- Oz%6y ri 4Mg%}/cC
return(0); Mrk3r/ 8w vX>{1`e{S
} 4C?{p%3c Hx+r9w
//+------------------------------------------------------------------+ :.AC%'S vWmt<E|e
//| Custom indicator iteration function | O;4S<N pSQX
//+------------------------------------------------------------------+ ?x ",VA 0B1nk!F
int start() *1v3x:pQ' 1:<n(?5JI
{ by9UwM=gp ,k.")
int limit; DOtz 38-kl,Vw
int counted_bars=IndicatorCounted(); @}UOm- M j8Q_s/n
double rsi_sig=0; &56\@t^ :s+?"'DP
bool entry=false; 8B6(SQp% m==DBh
double entry_point=0; [D|Uwq ~b*|V
4UL"f<7 T 7?g({]
//---- check for possible errors U>n.+/ss {TJ"O
if(counted_bars<0) return(-1); +;@R&Y w$s6NBF7
//---- last counted bar will be recounted qi_uob d$\n@}8eZp
if(counted_bars>0) counted_bars--; B&3@b mK7SEH;
limit=Bars-counted_bars; D#ED?Lqf 7a_u=\,
oe_,q&e :Id8N~g
//---- main loop x5yZ+`Gc DV?c%z`YO
for(int i=0; i<limit; i++) Y,%G5X@S< u9q#L.Ij
{ 0 KWi<G1 7/]Ra
//---- ma_shift set to 0 because SetIndexShift called abowe %$(*.o!+8 RK&RMN8@
ExtMapBuffer1=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i); _i&awm/U ,{ 0&NX
ExtMapBuffer2=iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i); <j89HtCz { O=_c|u{N
rsi_sig = iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, i); ~C],?X(zk W>CG;x{
fNaS?tV) "_rpErm
}
pipdiffCurrent=(ExtMapBuffer1-ExtMapBuffer2); U ()36 LDo~
j_*#"}Lcp /_(l:q^
Comment("pipdiffCurrent = "+pipdiffCurrent+" "); { wx!~K ?$\sMkn
if (pipdiffCurrent>0 && rsi_sig>50) %<w)#eV? F&+_z&n