النتائج 1 إلى 3 من 3
- 16-10-2017, 02:14 PM #1
اكسبيرت خدمي يعمل على الايكويتي وليس الربح
السلاع عليكم ورحمة الله وبركاته
بعد التحية,,,,
برجاء عمل اكسبيرت خدمي يعمل على الايكويتي وليس الربح بحيث
يوجد به خانة انا اضع بها مبلغ معين عندما يصل لها الايكويتي يتم اغلاق كل الصفقات المفتوحة
وتوجد خانة اخرى يمكنني فيها اختيار مبلغ الزيادة في الايكويتي الذي عندما يصل له الايكويتي يتم اغلاق كل الصفقات وهكذا
بمعني لو الاكويتي الان 5000 سوف اختار اول مبلغ وليكن 6000
ويوجد اختيار لاضع فيه الزيادة المطلوبة في كل مرة ولتكن 1000
اذا الاكسبيرت سيغلق الصفقات اول مرة عند 6000 ثم 7000 ثم 8000 وهكذا وبزيادة الـ 1000 التي تم اختيارها في اعدادات الاكسبيرت
وشكرا جزيلا على المساعدة.
- 16-10-2017, 04:50 PM #2كود PHP:
input double Target=5000000;
input double Margin=10;
bool t;
void OnTimer()
{//OnTimer
if(IsExpertEnabled())
{
ObjectCreate( "IsExpertEnabled",OBJ_LABEL,0,0,0);
ObjectSet( "IsExpertEnabled",OBJPROP_CORNER,0);
ObjectSet( "IsExpertEnabled",OBJPROP_XDISTANCE,5);
ObjectSet( "IsExpertEnabled",OBJPROP_YDISTANCE,20);
ObjectSetText("IsExpertEnabled",CharToStr(74),15,"Wingdings",clrLime);
ObjectCreate( "XXXIsExpertEnabled",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsExpertEnabled",OBJPROP_CORNER,0);
ObjectSet( "XXXIsExpertEnabled",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsExpertEnabled",OBJPROP_YDISTANCE,20);
ObjectSetText("XXXIsExpertEnabled","Expert Enabled",12,0,clrLime);
}
else
{
ObjectCreate( "IsExpertEnabled",OBJ_LABEL,0,0,0);
ObjectSet( "IsExpertEnabled",OBJPROP_CORNER,0);
ObjectSet( "IsExpertEnabled",OBJPROP_XDISTANCE,5);
ObjectSet( "IsExpertEnabled",OBJPROP_YDISTANCE,20);
ObjectSetText("IsExpertEnabled",CharToStr(76),15,"Wingdings",clrRed);
ObjectCreate( "XXXIsExpertEnabled",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsExpertEnabled",OBJPROP_CORNER,0);
ObjectSet( "XXXIsExpertEnabled",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsExpertEnabled",OBJPROP_YDISTANCE,20);
ObjectSetText("XXXIsExpertEnabled","Expert Disabled",12,0,clrRed);
}
if(IsTradeAllowed())
{
ObjectCreate( "IsTradeAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "IsTradeAllowed",OBJPROP_CORNER,0);
ObjectSet( "IsTradeAllowed",OBJPROP_XDISTANCE,5);
ObjectSet( "IsTradeAllowed",OBJPROP_YDISTANCE,41);
ObjectSetText("IsTradeAllowed",CharToStr(74),15,"Wingdings",clrLime);
ObjectCreate( "XXXIsTradeAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsTradeAllowed",OBJPROP_CORNER,0);
ObjectSet( "XXXIsTradeAllowed",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsTradeAllowed",OBJPROP_YDISTANCE,41);
ObjectSetText("XXXIsTradeAllowed","Trade Allowed",12,0,clrLime);
}
else
{
ObjectCreate( "IsTradeAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "IsTradeAllowed",OBJPROP_CORNER,0);
ObjectSet( "IsTradeAllowed",OBJPROP_XDISTANCE,5);
ObjectSet( "IsTradeAllowed",OBJPROP_YDISTANCE,41);
ObjectSetText("IsTradeAllowed",CharToStr(76),15,"Wingdings",clrRed);
ObjectCreate( "XXXIsTradeAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsTradeAllowed",OBJPROP_CORNER,0);
ObjectSet( "XXXIsTradeAllowed",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsTradeAllowed",OBJPROP_YDISTANCE,41);
ObjectSetText("XXXIsTradeAllowed","Trade NOT Allowed",12,0,clrRed);
}
if(IsConnected())
{
ObjectCreate( "IsConnected",OBJ_LABEL,0,0,0);
ObjectSet( "IsConnected",OBJPROP_CORNER,0);
ObjectSet( "IsConnected",OBJPROP_XDISTANCE,5);
ObjectSet( "IsConnected",OBJPROP_YDISTANCE,62);
ObjectSetText("IsConnected",CharToStr(74),15,"Wingdings",clrLime);
ObjectCreate( "XXXIsConnected",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsConnected",OBJPROP_CORNER,0);
ObjectSet( "XXXIsConnected",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsConnected",OBJPROP_YDISTANCE,62);
ObjectSetText("XXXIsConnected","Internet Connected",12,0,clrLime);
}
else
{
ObjectCreate( "IsConnected",OBJ_LABEL,0,0,0);
ObjectSet( "IsConnected",OBJPROP_CORNER,0);
ObjectSet( "IsConnected",OBJPROP_XDISTANCE,5);
ObjectSet( "IsConnected",OBJPROP_YDISTANCE,62);
ObjectSetText("IsConnected",CharToStr(76),15,"Wingdings",clrRed);
ObjectCreate( "XXXIsConnected",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsConnected",OBJPROP_CORNER,0);
ObjectSet( "XXXIsConnected",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsConnected",OBJPROP_YDISTANCE,62);
ObjectSetText("XXXIsConnected","Internet Disconnected",12,0,clrRed);
}
if(IsDllsAllowed())
{
ObjectCreate( "IsDllsAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "IsDllsAllowed",OBJPROP_CORNER,0);
ObjectSet( "IsDllsAllowed",OBJPROP_XDISTANCE,5);
ObjectSet( "IsDllsAllowed",OBJPROP_YDISTANCE,82);
ObjectSetText("IsDllsAllowed",CharToStr(74),15,"Wingdings",clrLime);
ObjectCreate( "XXXIsDllsAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsDllsAllowed",OBJPROP_CORNER,0);
ObjectSet( "XXXIsDllsAllowed",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsDllsAllowed",OBJPROP_YDISTANCE,82);
ObjectSetText("XXXIsDllsAllowed","Dlls Allowed",12,0,clrLime);
}
else
{
ObjectCreate( "IsDllsAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "IsDllsAllowed",OBJPROP_CORNER,0);
ObjectSet( "IsDllsAllowed",OBJPROP_XDISTANCE,5);
ObjectSet( "IsDllsAllowed",OBJPROP_YDISTANCE,82);
ObjectSetText("IsDllsAllowed",CharToStr(76),15,"Wingdings",clrRed);
ObjectCreate( "XXXIsDllsAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsDllsAllowed",OBJPROP_CORNER,0);
ObjectSet( "XXXIsDllsAllowed",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsDllsAllowed",OBJPROP_YDISTANCE,82);
ObjectSetText("XXXIsDllsAllowed","Dlls NOT Allowed",12,0,clrRed);
}
if(IsLibrariesAllowed())
{
ObjectCreate( "IsLibrariesAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "IsLibrariesAllowed",OBJPROP_CORNER,0);
ObjectSet( "IsLibrariesAllowed",OBJPROP_XDISTANCE,5);
ObjectSet( "IsLibrariesAllowed",OBJPROP_YDISTANCE,99);
ObjectSetText("IsLibrariesAllowed",CharToStr(74),15,"Wingdings",clrLime);
ObjectCreate( "XXXIsLibrariesAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsLibrariesAllowed",OBJPROP_CORNER,0);
ObjectSet( "XXXIsLibrariesAllowed",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsLibrariesAllowed",OBJPROP_YDISTANCE,99);
ObjectSetText("XXXIsLibrariesAllowed","Libraries Allowed",12,0,clrLime);
}
else
{
ObjectCreate( "IsLibrariesAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "IsLibrariesAllowed",OBJPROP_CORNER,0);
ObjectSet( "IsLibrariesAllowed",OBJPROP_XDISTANCE,5);
ObjectSet( "IsLibrariesAllowed",OBJPROP_YDISTANCE,99);
ObjectSetText("IsLibrariesAllowed",CharToStr(76),15,"Wingdings",clrRed);
ObjectCreate( "XXXIsLibrariesAllowed",OBJ_LABEL,0,0,0);
ObjectSet( "XXXIsLibrariesAllowed",OBJPROP_CORNER,0);
ObjectSet( "XXXIsLibrariesAllowed",OBJPROP_XDISTANCE,30);
ObjectSet( "XXXIsLibrariesAllowed",OBJPROP_YDISTANCE,99);
ObjectSetText("XXXIsLibrariesAllowed","Libraries NOT Allowed",12,0,clrYellow);
}
ObjectCreate("Target",OBJ_LABEL,0,0,0);
ObjectSet("Target",OBJPROP_CORNER,0);
ObjectSet("Target",OBJPROP_XDISTANCE,5);
ObjectSet("Target",OBJPROP_YDISTANCE,130);
ObjectSetText("Target","Target--- "+Target,14,"Tahoma",clrLime);
ObjectCreate("Margin",OBJ_LABEL,0,0,0);
ObjectSet("Margin",OBJPROP_CORNER,0);
ObjectSet("Margin",OBJPROP_XDISTANCE,5);
ObjectSet("Margin",OBJPROP_YDISTANCE,150);
ObjectSetText("Margin","Margin--- "+Margin,14,"Tahoma",clrRed);
if(MathAbs(AccountBalance()-AccountMargin())>10)
{//if(MathAb
if(AccountEquity()<Margin || AccountEquity()>Target)
{//if(AccountE
for(int i=OrdersTotal();i>=0;i--)
{//3
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{//4
if(OrderType()==OP_BUY || OrderType()==OP_SELL)
{//5
t=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3);
}//5
}//4
}//3
Sleep(2000);
for( i=OrdersTotal();i>=0;i--)
{//3
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{//4
if(OrderType()==OP_BUYLIMIT || OrderType()==OP_SELLLIMIT)
{//5
t=OrderDelete(OrderTicket());
}//5
}//4
}//3
}////if(AccountE
}//if(MathAb
}//OnTimer
int OnInit()
{ ObjectsDeleteAll();
ChartSetInteger(0,CHART_AUTOSCROLL,0,false);
ChartSetInteger(0,CHART_COLOR_ASK,clrNONE);
ChartSetInteger(0,CHART_COLOR_BACKGROUND,clrNONE);
ChartSetInteger(0,CHART_COLOR_BID,clrNONE);
ChartSetInteger(0,CHART_COLOR_CHART_LINE,clrNONE);
ChartSetInteger(0,CHART_COLOR_FOREGROUND,clrNONE);
ChartSetInteger(0,CHART_COLOR_GRID,clrNONE);
ChartSetInteger(0,CHART_COLOR_LAST,clrNONE);
ChartSetInteger(0,CHART_COLOR_STOP_LEVEL,clrNONE);
ChartSetInteger(0,CHART_DRAG_TRADE_LEVELS,0,false);
ChartSetInteger(0,CHART_FOREGROUND,0,false);
ChartSetInteger(0,CHART_MODE,CHART_LINE);
ChartSetInteger(0,CHART_MOUSE_SCROLL,0,false);
ChartSetInteger(0,CHART_QUICK_NAVIGATION,0,false);
ChartSetInteger(0,CHART_SHIFT,0,false);
ChartSetInteger(0,CHART_SHOW_ASK_LINE,0,false);
ChartSetInteger(0,CHART_SHOW_BID_LINE,0,false);
ChartSetInteger(0,CHART_SHOW_DATE_SCALE,0,false);
ChartSetInteger(0,CHART_SHOW_GRID,0,false);
ChartSetInteger(0,CHART_SHOW_LAST_LINE,0,false);
ChartSetInteger(0,CHART_SHOW_OHLC,0,false);
ChartSetInteger(0,CHART_SHOW_ONE_CLICK,0,false);
ChartSetInteger(0,CHART_SHOW_PERIOD_SEP,0,false);
ChartSetInteger(0,CHART_SHOW_PRICE_SCALE,0,false);
ChartSetInteger(0,CHART_SHOW_TRADE_LEVELS,clrNONE);
ChartSetInteger(0,CHART_SHOW_VOLUMES,CHART_VOLUME_HIDE);
ChartIndicatorDelete(0,0,ChartIndicatorName(0,0,0));
ChartIndicatorDelete(0,0,ChartIndicatorName(0,0,1));
ChartIndicatorDelete(0,0,ChartIndicatorName(0,0,2));
ChartIndicatorDelete(0,0,ChartIndicatorName(0,0,3));
ChartIndicatorDelete(0,0,ChartIndicatorName(0,0,4));
ChartIndicatorDelete(0,0,ChartIndicatorName(0,0,5));
ChartIndicatorDelete(0,1,ChartIndicatorName(0,1,0));
ChartIndicatorDelete(0,1,ChartIndicatorName(0,1,1));
ChartIndicatorDelete(0,1,ChartIndicatorName(0,1,2));
ChartIndicatorDelete(0,2,ChartIndicatorName(0,2,0));
ChartIndicatorDelete(0,2,ChartIndicatorName(0,2,1));
ChartIndicatorDelete(0,2,ChartIndicatorName(0,2,2));
EventSetTimer(1);
return(INIT_SUCCEEDED);
}
- 17-10-2017, 09:47 AM #3
برجاء التوضيح