#
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: Brain Trend 1 Stop
Description:
Brain Trend 1 Stop - Fixed to work with JPY symbols too
/*[[ Name := NRTR Author := VG many thanks to Konkop and dupidu Link := 4vg@mail.ru Separate Window := No First Color := Fuchsia First Draw Type := Symbol First Symbol := 159 Use Second Data := Yes Second Color := Aqua Second Draw Type := Symbol Second Symbol := 159 ]]*/ //----------------------------------------------------------------------- Input : AveragePeriod(10); //---------------------------------------------------------------------- Variable : bar(0); Variable : value(0); Variable : price(0); Variable : trend(0),dK(0), AvgRange(0),i(0); SetLoopCount(0); AvgRange=0; for i=1 To AveragePeriod { AvgRange+= Abs(High[i]-Low[i]); }; // fixed to Work with JPY Symbols if Point>=0.01 then dK = (AvgRange/AveragePeriod)*Point else dK = (AvgRange/AveragePeriod); if Close[Bars-1] > Open[Bars-1] then { value = Close[Bars - 1] * (1 - dK); trend = 1; SetIndexValue2(Bars - 1, value); }; if Close[Bars-1] < Open[Bars-1] then { value = Close[Bars - 1] * (1 + dK); trend = -1; SetIndexValue(Bars - 1, value); }; for bar = Bars - 2 downto 0 { if trend >= 0 then { if Close[bar] > price then price = Close[bar]; value = price * (1 - dK); if Close[bar] < value then { price = Close[bar]; value = price * ( + dK); trend = -1; }; } else if trend <= 0 then { if Close[bar] < price then price = Close[bar]; value = price * (1 + dK); if Close[bar] > value then { price = Close[bar]; value = price * (1 - dK); trend = 1; }; }; if trend = -1 then SetIndexValue(bar, value); if trend = 1 then SetIndexValue2(bar, value); }; // ----------------------
Author/Source:
4vg@mail.ru
Forex Directory
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact