#
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 MQ4 Experts
Title: Stochy
Description:
Stochy. Benefit only realized in Eur/Usd 1H , tweaking may make it work with other pairs too.
//+------------------------------------------------------------------+ //| Stoch.mq4 | //| For Eur/Usd 1H //| Copyright © 2005, Jacob Yego | //| http://PointForex.com | //+------------------------------------------------------------------+ extern double TakeProfit = 250; extern double Lots = 1.0; extern double TrailingStop = 60; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { double EMA1; double EMA2; double EMA3; double EMA4; double ATR; double RSI; double CCI; double Stoch; double Stochsig; int cnt,ticket,tt=0, total; // check TakeProfit on a chart of less than 200 bars if(Bars<200) { Print("bars less than 200"); return(0); } if(TakeProfit<10) { Print("TakeProfit less than 10"); return(0); // check TakeProfit } // data in internal variables for access speed EMA1=iMA(NULL,0,8,0,MODE_EMA,PRICE_CLOSE,0); EMA2=iMA(NULL,0,100,0,MODE_EMA,PRICE_CLOSE,0); EMA3=iMA(NULL,0,8,0,MODE_EMA,PRICE_CLOSE,1); EMA4=iMA(NULL,0,100,0,MODE_EMA,PRICE_CLOSE,1); ATR=iATR(NULL,0,20,0); RSI=iRSI(NULL,0,14,PRICE_CLOSE,0); CCI= iCCI(NULL,0,14,PRICE_CLOSE,0); Stoch=iStochastic(NULL,0,14,3,3,MODE_SMA,0,MODE_MAIN,0); Stochsig=iStochastic(NULL,0,14,3,3,MODE_SMA,0,MODE_SIGNAL,0); // to ensure that only one trade per pair is entered to avoid multiplicity total=OrdersTotal(); for(cnt=0;cnt
0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); } else Print("Error opening BUY order : ",GetLastError()); return(0); } // Short position (SELL) possibility if(EMA2 > EMA1 && EMA4 < EMA3 && RSI<50 && CCI<0 && Stoch
0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice()); } else Print("Error opening SELL order : ",GetLastError()); return(0); } return(0); } //Exit Strategy for(cnt=0;cnt
EMA1 && EMA4 < EMA3 && CCI<0 && Stoch
0) { if(Bid-OrderOpenPrice()>Point*TrailingStop) { if(OrderStopLoss()
70 && EMA1 > EMA2 && EMA3 < EMA4 && CCI>0 && Stoch>Stochsig) { OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position return(0); // exit } // trailing stop check if(TrailingStop>0) { if((OrderOpenPrice()-Ask)>(Point*TrailingStop)) { if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red); return(0); } } } } } } return(0); } // the end.
Author/Source:
Jacob Yego
Forex Directory
|
Free Forex Strategies
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact