النتائج 1 إلى 7 من 7
- 12-08-2022, 12:54 PM #1
كيف يمكن تغبر نقطة الدخول على اكسبيرت مستر دولار الخاص بالزجزاج
السلام عليكم ورحمة الله
هل اجد اجابة على طريقة تغير نقطة الدخول في اكسبيرت مستر دولار الخاص بالزجزاج
المطلوب هو ان يتراجع الاكسبيرت بعدد من النقاط او يتقدم
ماهو الكود المسؤول
كود PHP:input int MaxTrades=0;
input bool EnableTimeFilter=false;
input string Start_Hour="00:00";
input string End_Hour="23:00";
input bool CloseOnReverse=true;
input string info1="ZigZag Settings";
input int Depth=12;
input int Deviation=5;
input int BackStep=3;
input string info2="Multiplier Settings";
input bool EnableMultiplier=true;
input double Multiplier=2;
input string info3="Money Management";
input double Lots = 0.1;
input bool MoneyManagement=false;
input double Risk=10;
input bool AutoStopLoss=true;
input int StopLoss=0;
input int TakeProfit=0;
input int TrailingStop=0;
input int BreakEven=0;
input int BreakEvenPips=1;
input int MagicNumber=555;
datetime Timee;
double point;
int P;
int LotDecimal;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int OnInit()
{
if(MarketInfo(Symbol(),MODE_MINLOT)<0.1)LotDecimal=2;
else LotDecimal=1;
if(_Digits==5 || _Digits==3)P=10;
else P=1;
if(_Digits<4)
{
point=0.01;
}
else
{
point=0.0001;
}
CreatePanel("Panel_Info_Info1",OBJ_EDIT,"www.ArabicTrader.com",10,25,190,20,DodgerBlue,White,DodgerBlue,11,true,false,0,ALIGN_CENTER);
return(0);
}
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
ObjectDelete(0,"Panel_Info_Info1");
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int TotalOrders(int type)
{
int cnt=0;
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && MagicNumber==OrderMagicNumber() && OrderType()==type)
{
cnt++;
}
}
}
return(cnt);
}
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS Start function |
//+------------------------------------------------------------------+
bool TimeFilter(string StartH,string EndH)
{
datetime Start=StrToTime(TimeToStr(TimeCurrent(),TIME_DATE)+" "+StartH);
datetime End=StrToTime(TimeToStr(TimeCurrent(),TIME_DATE)+" "+EndH);
if(!(Time[0]>=Start && Time[0]<=End))
{
return(false);
}
return(true);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int Highest_ZZ_Shift,Lowest_ZZ_Shift;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double HighestZigZag()
{
int ZigZag_Num=0,High_Num;
double Highest_ZZ;
for(int i=0;i<Bars;i++)
{
double zz=iCustom(Symbol(),0,"ZigZag",Depth,Deviation,BackStep,0,i);
if(zz!=0)
{
ZigZag_Num++;
if(ZigZag_Num>1 && zz==High[i])
{
High_Num++;
if(zz>Highest_ZZ)
{
Highest_ZZ=zz;
Highest_ZZ_Shift=i;
}
}
if(High_Num>=3)return(Highest_ZZ);
}
}
return(Highest_ZZ);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
bool CheckFreshBreak(string type,double price)
{
if(type=="High")
{
for(int i=1;i<Highest_ZZ_Shift;i++)
{
if(High[i]>price)return(false);
}
return(true);
}
if(type=="Low")
{
for( i=1;i<Lowest_ZZ_Shift;i++)
{
if(Low[i]<price)return(false);
}
return(true);
}
return(true);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double LowestZigZag()
{
int ZigZag_Num=0,Low_Num;
double Lowest_ZZ;
for(int i=0;i<Bars;i++)
{
double zz=iCustom(Symbol(),0,"ZigZag",Depth,Deviation,BackStep,0,i);
if(zz!=0)
{
ZigZag_Num++;
if(ZigZag_Num>1 && zz==Low[i])
{
Low_Num++;
if(zz<Lowest_ZZ || Lowest_ZZ==0)
{
Lowest_ZZ=zz;
Lowest_ZZ_Shift=i;
}
}
if(Low_Num>=3)return(Lowest_ZZ);
}
}
return(Lowest_ZZ);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnTick()
{
Comment("Programmed By MR.dollar"+"\nIdea By ابو عبود"+"\nمنتدى المتداول العربي"+"\nwww.ArabicTrader.com");
if(TrailingStop>0)MoveTrailingStop();
if(BreakEven>0)MoveBreakEven();
if(EnableTimeFilter&&TimeFilter(Start_Hour,End_Hour)==false)return;
double NewLot;
if(MoneyManagement) NewLot=LotManage();
else NewLot=Lots;
int ticket;
double SL,TP;
static int LastSignal=0;
double highest_zigzag=HighestZigZag();
double lowest_zigzag=LowestZigZag();
if(Open[0]<highest_zigzag && Close[0]>highest_zigzag && highest_zigzag!=0 && CheckFreshBreak("High",highest_zigzag) && Timee!=Time[0])
{
if(CloseOnReverse)
CloseOrders(OP_SELL);
if(TotalOrders(OP_BUY)<MaxTrades || MaxTrades==0)
{
if(StopLoss==0){SL=0;}else{SL=Ask-StopLoss*point;}
if(TakeProfit==0){TP=0;}else{TP=Ask+TakeProfit*point;}
if(AutoStopLoss)SL=LowestZigZag();
if(EnableMultiplier && LastOrderInfo("Profit")<0)NewLot=LastOrderInfo("Lots")*Multiplier;
ticket=OrderSend(Symbol(),OP_BUY,NormalizeDouble(NewLot,LotDecimal),NormalizeDouble(Ask,Digits),3*P,SL,TP,"EA",MagicNumber,0,Blue);
if(ticket<0)Alert("Error Open Order "+GetLastError());
PlaySound("Alert.wav");
Timee=Time[0];
}
}
if(Open[0]>lowest_zigzag && Close[0]<lowest_zigzag && lowest_zigzag!=0 && CheckFreshBreak("Low",lowest_zigzag) && Timee!=Time[0])
{
if(CloseOnReverse)
CloseOrders(OP_BUY);
if(TotalOrders(OP_SELL)<MaxTrades || MaxTrades==0)
{
if(StopLoss==0){SL=0;}else{SL=Bid+StopLoss*point;}
if(TakeProfit==0){TP=0;}else{TP=Bid-TakeProfit*point;}
if(AutoStopLoss)SL=HighestZigZag();
if(EnableMultiplier && LastOrderInfo("Profit")<0)NewLot=LastOrderInfo("Lots")*Multiplier;
ticket=OrderSend(Symbol(),OP_SELL,NormalizeDouble(NewLot,LotDecimal),NormalizeDouble(Bid,Digits),3*P,SL,TP,"EA",MagicNumber,0,Red);
if(ticket<0)Alert("Error Open Order "+GetLastError());
PlaySound("Alert.wav");
Timee=Time[0];
}
}
}
//+------------------------------------------------------------------+
double LastOrderInfo(string info)
{
for(int i=OrdersHistoryTotal()-1;i>=0;i--)
{
bool select=OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)
{
if(info=="Profit")return(OrderProfit());
else if(info=="Lots")return(OrderLots());
}
}
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CloseOrders(int type)
{
for(int cnt=OrdersTotal()-1;cnt>=0;cnt--)
{
bool select=OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
int ticket=OrderTicket();
double lots=OrderLots();
int Otype=OrderType();
if(OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol() && OrderType()==type)
{
if(Otype==OP_BUY)
{
bool close=OrderClose(ticket,lots,NormalizeDouble(Bid,Digits),3*P);
}
if(Otype==OP_SELL)
{
close=OrderClose(ticket,lots,NormalizeDouble(Ask,Digits),3*P);
}
}
}
}
//+------------------------------------------------------------------+
//| FUNCTION DEFINITIONS TrailingStop |
//+------------------------------------------------------------------+
void MoveTrailingStop()
{
for(int cnt=0;cnt<OrdersTotal();cnt++)
{
bool select=OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderType()<=OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)
{
if(OrderType()==OP_BUY)
{
if(TrailingStop>0 && NormalizeDouble(Ask,Digits)>NormalizeDouble(OrderOpenPrice()+TrailingStop*point,Digits))
{
if((NormalizeDouble(OrderStopLoss(),Digits)<NormalizeDouble(Bid-TrailingStop*point,Digits)) || (OrderStopLoss()==0))
{
bool modify=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-TrailingStop*point,Digits),OrderTakeProfit(),0,Blue);
}
}
}
else
{
if(TrailingStop>0 && NormalizeDouble(Bid,Digits)<NormalizeDouble(OrderOpenPrice()-TrailingStop*point,Digits))
{
if((NormalizeDouble(OrderStopLoss(),Digits)>(NormalizeDouble(Ask+TrailingStop*point,Digits))) || (OrderStopLoss()==0))
{
modify=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Ask+TrailingStop*point,Digits),OrderTakeProfit(),0,Red);
}
}
}
}
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void MoveBreakEven()
{
for(int cnt=0;cnt<OrdersTotal();cnt++)
{
bool select=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)
{
bool modify=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()+BreakEvenPips*point,Digits),OrderTakeProfit(),0,Blue);
}
}
}
}
else
{
if(BreakEven>0)
{
if(NormalizeDouble((OrderOpenPrice()-Ask),Digits)>BreakEven*point)
{
if(NormalizeDouble((OrderOpenPrice()-OrderStopLoss()),Digits)<0)
{
modify=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()-BreakEvenPips*point,Digits),OrderTakeProfit(),0,Red);
}
}
}
}
}
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double LotManage()
{
double lot=MathCeil(AccountFreeMargin() *Risk/1000)/100;
if(lot<MarketInfo(Symbol(),MODE_MINLOT))lot=MarketInfo(Symbol(),MODE_MINLOT);
if(lot>MarketInfo(Symbol(),MODE_MAXLOT))lot=MarketInfo(Symbol(),MODE_MAXLOT);
return (NormalizeDouble(lot,LotDecimal));
}
void CreatePanel(string name,ENUM_OBJECT Type,string text,int XDistance,int YDistance,int Width,int Hight,
color BGColor_,color InfoColor,color boarderColor,int fontsize,bool readonly=false,bool Obj_Selectable=false,int Corner=0,ENUM_ALIGN_MODE Align=ALIGN_LEFT)
{
if(ObjectFind(0,name)==-1)
{
ObjectCreate(0,name,Type,0,0,0);
ObjectSetInteger(0,name,OBJPROP_XDISTANCE,XDistance);
ObjectSetInteger(0,name,OBJPROP_YDISTANCE,YDistance);
ObjectSetInteger(0,name,OBJPROP_XSIZE,Width);
ObjectSetInteger(0,name,OBJPROP_YSIZE,Hight);
ObjectSetString(0,name,OBJPROP_TEXT,text);
ObjectSetString(0,name,OBJPROP_FONT,"Arial Bold");
ObjectSetInteger(0,name,OBJPROP_FONTSIZE,fontsize);
ObjectSetInteger(0,name,OBJPROP_CORNER,Corner);
ObjectSetInteger(0,name,OBJPROP_COLOR,InfoColor);
ObjectSetInteger(0,name,OBJPROP_BORDER_TYPE,BORDER_FLAT);
ObjectSetInteger(0,name,OBJPROP_BORDER_COLOR,boarderColor);
ObjectSetInteger(0,name,OBJPROP_BGCOLOR,BGColor_);
ObjectSetInteger(0,name,OBJPROP_SELECTABLE,Obj_Selectable);
if(Type==OBJ_EDIT)
{
ObjectSetInteger(0,name,OBJPROP_ALIGN,Align);
ObjectSetInteger(0,name,OBJPROP_READONLY,readonly);
}
}
if(ObjectDescription(name)!=text && readonly==true)
{
ObjectSetString(0,name,OBJPROP_TEXT,text);
}
}
//+---------------------------------------------------------------------------------+
- 12-08-2022, 01:49 PM #2
أن يكون دخول صفقة السال قبل نزول السعر الى خط المؤشر (خط النقاط الصفراء ) بعدد معين من النقاط
و على ان يكون دخول صفقة باي قبل صعود السعر الى خط المؤشر (خط النقاط الزرقاء) بعدد معين من النقاط
- 16-08-2022, 12:04 AM #3
دخول يكون قبل 5 نقاط فقط نرجو المساعدة
- 16-08-2022, 03:40 PM #4
- 16-08-2022, 06:03 PM #5
- 16-08-2022, 11:59 PM #6
لكن أود ان اسألك فيه ايضا انا هذا الكود ابسط و مربح مقارنة بالثاني
كود:if(Close[1]>highest_zigzag && Timee!=Time[0])
كود:if(Open[0]<highest_zigzag && Close[0]>highest_zigzag && highest_zigzag!=0 && CheckFreshBreak("High",highest_zigzag) && Timee!=Time[0])
اما لعمليات SELL
هذا الكود ابسط و مربح مقارنة بالثاني
كود:if(Open[0]>lowest_zigzag && Close[0]<lowest_zigzag && lowest_zigzag!=0 && CheckFreshBreak("Low",lowest_zigzag) && Timee!=Time[0])
كود:if(Close[1]<lowest_zigzag && Timee!=Time[0])
- 01-09-2022, 05:13 PM #7