#
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Home
Forex Forum
+ Add Script
Metastock
Expert Advisors
Explorations
Indicators
Trading Systems
Metatrader
MQL Experts
MQL Indicators
MQ4 Experts
MQ4 Indicators
MQ4 Scripts
Tradestation
Functions
Indicators
PaintBars
ShowMe
Trading Systems
Amibroker
Commentaries
Explorations
Functions
Indicators
Trading Systems
Contact us
Newsletter
Group: Metatrader MQL Indicators
Title: Demark Trend Lines & Prices Down
Description:
Demark Trend Lines & Prices Down
/*[[ Name := DMTrendLines&PricesDown Author := Copyright © 2003, Company Link := http://www.company.com/ Separate Window := No First Color := Red First Draw Type := Line First Symbol := 217 Use Second Data := No Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ Variable : shift(0); Variable : KDown(0), BDown(0), MaxPrice(0),TargetPriceDown(0),n(0); Array : TrendPriceDown[2,1](0); Arrays : Minimum[2,1](0), TimeofMinimum[2,1](0), shiftofMinimum[2,1](0); SetLoopCount(0); // loop from first bar to current bar (with shift=0) For shift = Bars - 1 DownTo 1 Begin { TrendPriceDown[1,1] = TrendPriceDown[2,1]; TrendPriceDown[2,1] = KDown*(shift) + BDown; SetIndexValue(shift, TrendPriceDown[2,1]); If Low[shift] < Low[shift - 1] AND Low[shift] <= Low[shift + 1] //???? ????? - ????????, ???????????? Then {Minimum[1,1] = Minimum[2,1]; TimeofMinimum[1,1] = TimeofMinimum[2,1]; //??? ?????????? shiftofMinimum[1,1] = shiftofMinimum[2,1]; shiftofMinimum[2,1] = shift; Minimum[2,1] = Low[shift]; TimeofMinimum[2,1] = Time[shift]; KDown = (Minimum[2,1]-Minimum[1,1])/(shiftofMinimum[2,1]-shiftofMinimum[1,1]); //??????????? ????? ????? BDown = Minimum[1,1] - KDown*shiftofMinimum[1,1]; TrendPriceDown[2,1] = KDown*(shift) + BDown; If Minimum[1,1] <= Minimum[2,1] //???? ????? ????, Then {For n = shiftofMinimum[1,1] DownTo shiftofMinimum[2,1] Begin //??????????? ???? ?? ?????? ??????, { //??????? ? ??? ?????? TrendPriceDown[2,1] = KDown*(n) + BDown; SetIndexValue(n, TrendPriceDown[2,1]); }; End; //????? ????? ???? MoveObject("DownTrend", OBJ_TRENDLINE, TimeofMinimum[1,1], Minimum[1,1], TimeofMinimum[2,1], Minimum[2,1], Red, 1, STYLE_SOLID); //??????????????? }; }; If Close[shift] < TrendPriceDown[2,1] AND Close[shift+1] >= TrendPriceDown[1,1] //? ????? ????????? ????, AND TrendPriceDown[1,1] <= TrendPriceDown[2,1] //?????????????? ???? ???????. Then {MaxPrice = High[Highest(MODE_HIGH, shiftofMinimum[1,1], shiftofMinimum[1,1] - shift)]; //?????????????? ???? ??????? TargetPriceDown = TrendPriceDown[2,1] - (MaxPrice - TrendPriceDown[2,1]); MoveObject("TargetPriceDown"+Mod(shift,1), OBJ_HLINE, TimeofMinimum[1,1], TargetPriceDown, TimeofMinimum[2,1], TargetPriceDown, Red, 1, STYLE_DOT); }; }; End;
Author/Source:
?
Forex Directory
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact