#
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 Experts
Title: 2EMA system
Description:
2EMA system 2 moving avg envelope trader for EUR 5 minute charts
/*[[ Name := 2EMA system Author := Copyright © 2003, Gerry Link := http://www.company.com/ Notes := Update on every tick := Yes Enable Alerts := Yes Disable alert once hit := No Lots := 1 Stop Loss := 50 Take Profit := 2000 Trailing Stop := 15 ]]*/ vars: Slippage(2),MATrendPeriod(60),n(0),m(0); defines: CountBars(2),CountPeriods(2); vars: sl(0),tp(0); defines: Y(4),Z(1),W(1); vars:ADX1(0),ADX2(0); var: s(0); var: b(0); vars : cnt(0),first(0); If Bars<100 or TakeProfit<10 then Exit; If IsIndirect(Symbol)=TRUE then Exit; If CurTime - LastTradeTime < 300 Then Exit; b=5*Point+iATR(10,1)*4.5; s=5*Point+iATR(10,1)*4.5; //Y=4; //Z=1; //W=1; If TotalTrades<1 then { sl=Bid+StopLoss*Point; if (iMA(300,MODE_SMA,2)
iMA(30,MODE_EMA,0)*0.998)| (iMA(300,MODE_SMA,2)
iMA(30,MODE_EMA,0)*1.002 and iMA(300,MODE_SMA,0)>iMA(30,MODE_EMA,0)*0.998 and //Bid
Bid ) and iForce(6,MODE_SMA,PRICE_CLOSE,1)>iForce(6,MODE_SMA,PRICE_CLOSE,0) then { SetOrder(OP_SELL,Lots,Bid,Slippage,sl,Bid-TakeProfit*Point,White); Exit; }; sl=Ask-StopLoss*Point; if (iMA(300,MODE_SMA,2)>iMA(30,MODE_EMA,2)*1.002 and iMA(300,MODE_SMA,0)
iMA(30,MODE_EMA,2)*0.998 and iMA(300,MODE_SMA,0)
Open[1]and iSAR(0.02,0.2,0)
(OrderValue(cnt,Val_OPENPRICE)*0.005) and iSAR(0.0005,0.3,0)>Bid and iForce(60,MODE_SMA,PRICE_CLOSE,0)<0 then { CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Bid,Slippage,SlateBlue); Exit; }; If (Bid-OrderValue(cnt,VAL_OPENPRICE))>(b)then { If OrderValue(cnt,VAL_STOPLOSS)<(Bid-b) then { ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_OPENPRICE), Bid-b,OrderValue(cnt,VAL_TAKEPROFIT),SlateBlue); Exit; }; }; }; If OrderValue(cnt,VAL_TYPE)=OP_SELL and OrderValue(cnt,VAL_SYMBOL)=Symbol then { If OrderValue(cnt,Val_OPENPRICE)-Ask
(OrderValue(cnt,Val_OPENPRICE)*0.005) and iSAR(0.0005,0.3,0)
0 then { CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Ask,Slippage,Red); Exit; }; If (OrderValue(cnt,VAL_OPENPRICE)-Ask)>(s) then { If OrderValue(cnt,VAL_STOPLOSS)>(Ask+s) then { ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_OPENPRICE), Ask+s,OrderValue(cnt,VAL_TAKEPROFIT),Red); Exit; }; }; };end;
Author/Source:
Gerry
Forex Directory
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact