2 مرفق
أستاذنا أسامه ( عايز أتعلم تغيير مؤشر بدلا من مؤشر فى هذا الاكسيبرت )
السلام عليكم ورحمة الله وبركاته
أستاذنا أسامه باشا
عايز أتعلم تغيير مؤشر بدلا من مؤشر فى هذا الاكسيبرت
الذى قمت بتصميمه ياغالى لأعضاء المنتدى وهو باسم stochastic ea(2) وموجود بالمرفقات
والمطلوب ياغالى تغيير مؤشر stochastic بهذا المؤشر T3 ALPHA
الموجود فى المرفقات والذى تفضل سابقا بوضعه فى المنتدى الأخ الكريم deadsoul
مع بقاء نفس الاعدادات كما هى بالاكسيبرت مع خيار true * false
لأضافة اغلاق الصفقة فى حالة انعكاس الاشارة
وتقبل منى كل تحية وتقدير يا خبير العرب المؤشرات والاكسيبرتات
أستاذنا اسامه باشا
همسة هامة جدا جدا : للعلم فقط انا أبيض فى برمجة الاكسيبرتات هههههههههه
:18::18::18::18::18:
كود PHP:
//+------------------------------------------------------------------+
//| |
//| |
//| www.arabictrader.com/vb |
//| |
//| [email protected] |
//+------------------------------------------------------------------+
#property copyright "MR.dollarEA"
#property link "[email protected]"
extern int MaxTrades = 1;
extern bool UseHourTrade = false;
extern int FromHourTrade = 7;
extern int ToHourTrade = 17;
extern string MM_Parameters = "---------- Money Management";
extern double Lots = 1;
extern bool MM = false,
AccountIsMicro = false;
extern int Risk = 10;
extern string S5="---------------- Order Management";
extern int StopLoss=0;
extern int TakeProfit=0;
extern int BreakEven=0;
extern int movestopto=1;
extern int TrailingStop=0;
extern int TrailingStep=0;
datetime Time0;
double point;
int digits;
extern int MagicNumber=2533;
int init()
{
if(Digits<4)
{
point=0.01;
digits=2;
}
else
{
point=0.0001;
digits=4;
}
return(0);
}
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS deinitialization function |
//+------------------------------------------------------------------+
void deinit() {
Comment("");
}
int orderscnt(){
int cnt=0;
for(int i =0;i<OrdersTotal();i++){
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
if(OrderSymbol()==Symbol() && MagicNumber==OrderMagicNumber()){
cnt++;
}
}
}
return(cnt);
}
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS Start function |
//+------------------------------------------------------------------+
int start()
{
Comment("Programmed by MR.dollar"+"\n"+"\n"+"منتدى المتداول العربي"+"\n"+"www.arabictrader.com/vb");
if (UseHourTrade){
if(!((FromHourTrade < ToHourTrade && TimeHour(TimeCurrent()) >= FromHourTrade && TimeHour(TimeCurrent()) < ToHourTrade) || (FromHourTrade > ToHourTrade && TimeHour(TimeCurrent()) >= FromHourTrade ||
TimeHour(TimeCurrent()) < ToHourTrade))){
Comment("Non-Trading Hours!");
return(0);
}
}
//|---------trailing stop
if(TrailingStop>0)MoveTrailingStop();
if(BreakEven>0)MoveBreakEven();
//////////////////////////////////////////////////
double stochm=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,1);
double stochs=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,1);
double stochm2=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,2);
double stochs2=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,2);
////////////////////////////////////////////////////
double SL,TP;
if(MM) Lots = subLotSize();
////////////////////////////////
if (stochm2<20&&stochs2<20&&stochm2<stochs2&&stochm>stochs){
if(orderscnt()<MaxTrades){
if(StopLoss==0){SL=0;}else{SL=Ask-StopLoss*Point;}
if(TakeProfit==0){TP=0;}else{TP=Ask+TakeProfit*Point;}
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,SL,TP,"MR.dollar EA",MagicNumber,0,Blue);
PlaySound("Alert.wav");
}
}
/////////////////////
if (stochm2>80&&stochs2>80&&stochm2>stochs2&&stochm<stochs){
if(orderscnt()<MaxTrades){
if(StopLoss==0){SL=0;}else{SL=Bid+StopLoss*Point;}
if(TakeProfit==0){TP=0;}else{TP=Bid-TakeProfit*Point;}
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,SL,TP,"MR.dollar EA",MagicNumber,0,Red);
PlaySound("Alert.wav");
}
}
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS TrailingStop |
//+------------------------------------------------------------------+
//|---------trailing stop
void MoveTrailingStop()
{
int cnt,total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderType()<=OP_SELL&&OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber)
{
if(OrderType()==OP_BUY)
{
if(TrailingStop>0&&NormalizeDouble(Ask-TrailingStep*point,digits)>NormalizeDouble(OrderOpenPrice()+TrailingStop*point,digits))
{
if((NormalizeDouble(OrderStopLoss(),digits)<NormalizeDouble(Bid-TrailingStop*point,digits))||(OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-TrailingStop*point,digits),OrderTakeProfit(),0,Blue);
return(0);
}
}
}
else
{
if(TrailingStop>0&&NormalizeDouble(Bid+TrailingStep*point,digits)<NormalizeDouble(OrderOpenPrice()-TrailingStop*point,digits))
{
if((NormalizeDouble(OrderStopLoss(),digits)>(NormalizeDouble(Ask+TrailingStop*point,digits)))||(OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Ask+TrailingStop*point,digits),OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
void MoveBreakEven()
{
int cnt,total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderType()<=OP_SELL&&OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber)
{
if(OrderType()==OP_BUY)
{
if(BreakEven>0)
{
if(NormalizeDouble((Bid-OrderOpenPrice()),digits)>BreakEven*point)
{
if(NormalizeDouble((OrderStopLoss()-OrderOpenPrice()),digits)<0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()+movestopto*point,digits),OrderTakeProfit(),0,Blue);
return(0);
}
}
}
}
else
{
if(BreakEven>0)
{
if(NormalizeDouble((OrderOpenPrice()-Ask),digits)>BreakEven*point)
{
if(NormalizeDouble((OrderOpenPrice()-OrderStopLoss()),digits)<0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()-movestopto*point,digits),OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
}
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS Money Managment |
//+------------------------------------------------------------------+
double subLotSize()
{
double lotMM = MathCeil(AccountFreeMargin() * Risk / 1000) / 100;
if(AccountIsMicro==false)
{
if(lotMM < 0.1) lotMM = Lots;
if((lotMM > 0.5) && (lotMM < 1)) lotMM = 0.5;
if(lotMM > 1.0) lotMM = MathCeil(lotMM);
if(lotMM > 100) lotMM = 100;
}
else
{
if(lotMM < 0.01) lotMM = Lots;
if(lotMM > 1.0) lotMM = MathCeil(lotMM);
if(lotMM > 100) lotMM = 100;
}
return (lotMM);
}
//+---------------------------------------------------------------------------------+