SetChartOptions(3, chartShowDates); GfxSetOverlayMode( mode = 1 ); nn = StrToNum(ParamList("Days", "1|2|3", 1)); box = Param("step", 10, 1, 100, 1)*TickSize; NewDay = Day()!

= Ref(Day(), -1); DH = LastValue(HighestSince(NewDay, H, nn)); DL = LastValue(LowestSince(NewDay, L, nn)); Range = DH - DL; steps = ceil(Range/box); // linage height = Status("pxheight") - 50; // width of the profile (indention overhand 30 from below 20 pixels) boxheight = LastValue(height/steps); // size of the box width = (Status("pxwidth")-110)/3; profiles bars = Highest(BarsSince(NewDay)); ColorStep = LastValue(185/bars); // ????????? ????????????? ???? L = IIf(C > Ref(C, -1) AND L > Ref(C, - 1) AND NOT NewDay, Ref(C, -1), L); H = IIf(C < Ref(C, -1) AND H < Ref(C, - 1) AND NOT NewDay, Ref(C, -1), H); function GetDayPrice( fild, shift) { DayPrice = LastValue(TimeFrameGetPrice(fild, inDaily, -shift)); return DayPrice; } function pixlev(price) { result = 30 + (DH - price)/box * boxheight; return result; } procedure PlotProfile(DH, DL, begini, endi, disp) { m = 0; for(j = DH; j > DL; j = j-box) { n = 0; for(i = begini; i < endi; i++) { if(H[i] >= j AND L[i] <= j) { GfxSelectPen( colorBlack, 1, 0); GfxSelectSolidBrush(ColorHSB((i-begini)*ColorSte p, 255, 255)); GfxRectangle( disp+n*boxheight, 30+m*boxheight, disp+(n+1)*boxheight, 30+(m+1)*boxheight); n++; } } m++; } } // offset of the

"Tahoma". x2. 5). ValueWhen(NewDay. GfxPolyline( x1. 255). q-1) > GetDayPrice("C". PlotRect(50 + width*(nn-q). 50 + width*(nn-q)). // plot high price colorBlack. "Tahoma". colorBlack) . pixlev(GetDayPrice("C". 0). y1. pixlev(GetDayPrice("C". y2). q-1)). 10. co lorGreen)). Color) { GfxSelectPen(Color. pixlev(GetDayPrice("C". x2. BarCount. PlotPrice( " "+NumToStr(GetDayPrice("H". q-1)). PlotRect(50 + width*(nn-q). q-1)). FontSize. 2). GfxSetTextAlign( xAlign|yAlign). q-1)). q-1) > GetDayPrice("C". q-1) > GetDayPrice("C". q-1) > GetDayPrice("C". 255))). 0 ). 0. q-1)). q-1))+" ". GfxRectangle(x1. x. ColorHSB(15. q-1)). pixlev(GetDayPrice("H". PlotPrice( " open " + NumToStr(GetDayPrice("O". // day range 50 + width*(nn-q+1). xAlign) { GfxSetBkMode(1). BarIndex(). ColorHSB(80. y1. y1. GfxSetTextColor(Color). "Tahoma". GfxSelectFont(FontName. q--) { begini = LastValue(ValueWhen(NewDay. 50+width*(nn-q). pixlev(GetDayPrice("H". q-1)). . 10 . 0. y2. height+40. q-1))+" ". // vertical line PlotPrice( " close " + NumToStr(GetDayPrice("C". FontName. x2. q-1). 8. PlotLine(50 + width*(nn-q). PlotPrice(" "+NumToStr(GetDayPrice("L". 0). q-1)). GfxSelectSolidBrush(Color). y1. 600). IIf( GetDayPrice("O". // plot open price colorBlack. "Tahoma". BarIndex(). q-1). 1 0. IIf(GetDayPrice("O". 8). 50+width*(nn-q+1). // plot close price IIf( GetDayPrice("O". y2). q-1)). } procedure PlotPrice(Text. DL.procedure PlotLine(x1. colorLightYe llow). y2. q-1)). 50+width*(nn-q+1). } procedure PlotRect(x1. 8. FontSize. 40. 40. colorRed. endi = LastValue(IIf(q == 1. pixlev(GetDayPrice("C". q)). 10. yAlign. 0. q-1)). PlotProfile(DH. q-1). pixlev(GetDayPrice("O". colorRed. x2. x. q-1) > GetDayPrice("C". IIf( GetDayPrice("O". // open-close range 50 + width*(nn-q+1). q > 0. Color) { GfxSelectPen(Color. 50 + width*(nn-q). IIf( GetDayPrice("O". y. pixlev(GetDayPrice("L". y). q-1). q-1 ))). 2). PlotLine(50 + width*(nn-q). // close line 50 + width*(nn-q+1). } for(q = nn. pixlev(GetDayPrice("O". 1. q-1). begini. endi. Color. // dont work orientation GfxTextOut(Text. co lorGreen).

q-1)). Hi %g. 0. SelectedValue( ROC( C. L. } Title = Title = StrFormat("{{NAME}} . C. 50+width*(nn-q).{{INTERVAL}} {{DATE}} Open %g. 1 ) ) ). H.1f%%) {{VALUES}}". 0 ).// plot low price colorBlack. O. . pixlev(GetDayPrice("L". Close %g (%. Lo % g.

Sign up to vote on this title
UsefulNot useful