//+------------------------------------------------------------------+ >QA;02
//| Display .mq4 | >508-)'
//| | uXm_ pQpF
//| | I@M3u/7
//+------------------------------------------------------------------+ y~r5KB6w
Y9w^F_relL
YqEB%Y~N+
#property indicator_chart_window b"PRa|]
#property indicator_buffers 1 ;
`Vbl_"L
#property indicator_color1 Red ETMF.-P
#property indicator_width1 1 cq0#~20
ZDl6F`
//---- indicator buffers XPfheV G
qHf8z;lc
1R"?X'w
double TodayOpenBuffer[]; t
\;,$i
[6}>?
0)HZ5^J
//---- input parameters vNIQ1x5Za
5LVzT1j|
//+------------------------------------------------------------------+ ^E}};CsT
//| Custom indicator initialization function | Bf+7;4-
//+------------------------------------------------------------------+ -+,3aK<[
int init() WcZck{ehd
{ =1e>$E#
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID); $9Pscu bM4
SetIndexBuffer(0,TodayOpenBuffer); pdEUDuX
{~a+dEz
SetIndexEmptyValue(0,0.0); 8TV
"9{
n
TD6MP9L
QsC6\Gt#
Bq*aP*jv
x!^u$5c
return(0); o@j)clf
} o5`LLVif5y
//+------------------------------------------------------------------+ } Rs@
//| Custom indicator deinitialization function | d^W1;0
//+------------------------------------------------------------------+ tShyG!b
int deinit() o|O|e9m(
{ 2Pz)vnV"
//---- jt,dr3|/n
ObjectsDeleteAll(); 3,[#%}1(S
//---- &m8Z3+Ea
return(0); 9zs!rlzQ
} +q-/~G'
//+------------------------------------------------------------------+ j|X>:!4r
//| Custom indicator iteration function | \Uh$%#}.
//+------------------------------------------------------------------+ N`1W"Rx!
/@qnEP%
int start() 2(5<Wj"
{ 6X`i*T$.
int lastbar; guc[du
int counted_bars= IndicatorCounted(); jSc!"Trl]
k?7V#QW(
if (counted_bars>0) counted_bars--; s.qo/o\b
lastbar = Bars-counted_bars; Pua|Z
x
DailyOpen(0,lastbar); nEgDwJ<wl
Ae[Na:G+
.0]\a~x
MFzJ 8^.1R
} IF~E;
rU!QXg]uD
n> tru L
//+------------------------------------------------------------------+ uw>O|&!
M%(^GdI#Vf
int DailyOpen(int offset, int lastbar) {a9(
Qi
{ )Gm,%[?2C
int shift; iO@UzD#v
int k,counter; `p'682x I
h
]6:`5-
for(shift=lastbar;shift>=offset;shift--){ slTE.
if(TimeYear(Time[shift]) != TimeYear(Time[shift+1])) nr]:Y3KyxX
{ for (counter=k ;counter<=k+11;counter++) E^4}l2m_
{TodayOpenBuffer[shift]=MathMin( Low[shift-counter],TodayOpenBuffer[shift]); //就是这句 yQ!I`T>a
TodayOpenBuffer[shift+1]= 0; } '4ip~>3?w
} Zk ] /m
else{ mgE
r+
TodayOpenBuffer[shift]= TodayOpenBuffer[shift+1]; ZA+w7S3
} lG5KZ[/Or
} ]{|
wU.
return(0); U'aJCM
} tj4/x7!
rS8}(lf
Y'<wE2ZL)
放月周期 谢谢 帮助