FX-Arabia

جديد المواضيع















الملاحظات

منتدى المؤشرات و الاكسبيرتات تعليم برمجة الاكسبيرت ، اكسبيرت مجانى ، برمجة مؤشرات ، مؤشر ، تصميم اكسبيرت مجانا ، اكسبيرتات جديدة ، مؤشرات جديدة ، كل ما يتعلق بالتحليل و الخاص بالمؤشرات الفنية او الرقمية ، Expert advisor ، mql ، mql4 ، دورة برمجة ، برمجة اكسبيرت ، اكسبيرت رابح ، اكسبيرت جيد ، ادارة حسابات ، تداول الى ، ميتاتريدر ، تحميل منصة ، منصة تداول ، برمجة مؤشر ، مكتبة مؤشرات ، مؤشر جديد ، مؤشرات جديدة ، مؤشر حصرى ، احدث مؤشر .


الى استاذ اسلام ارجو المساعده

منتدى المؤشرات و الاكسبيرتات


إضافة رد
 
أدوات الموضوع
قديم 04-02-2016, 03:26 PM   المشاركة رقم: 1
الكاتب
sal_moh85
عضو جديد

البيانات
تاريخ التسجيل: Dec 2012
رقم العضوية: 12726
العمر: 38
المشاركات: 115
بمعدل : 0.03 يوميا

الإتصالات
الحالة:
sal_moh85 غير متواجد حالياً
وسائل الإتصال:

المنتدى : منتدى المؤشرات و الاكسبيرتات
افتراضي الى استاذ اسلام ارجو المساعده

invalid integer number as parameter 2 for 'iCustom' function
ما معنى هذه الرساله في اكسبيرت وطريقة تصحيحيها وشكرا



عرض البوم صور sal_moh85  
رد مع اقتباس


  #1  
قديم 04-02-2016, 03:26 PM
sal_moh85 sal_moh85 غير متواجد حالياً
عضو جديد
افتراضي الى استاذ اسلام ارجو المساعده

invalid integer number as parameter 2 for 'iCustom' function
ما معنى هذه الرساله في اكسبيرت وطريقة تصحيحيها وشكرا




رد مع اقتباس

قديم 04-02-2016, 04:15 PM   المشاركة رقم: 2
الكاتب
اسلام العوامى
عضو ذهبى
الصورة الرمزية اسلام العوامى

البيانات
تاريخ التسجيل: Apr 2012
رقم العضوية: 9148
الدولة: alexandria - egypt
المشاركات: 6,086
بمعدل : 1.39 يوميا

الإتصالات
الحالة:
اسلام العوامى غير متواجد حالياً
وسائل الإتصال:

كاتب الموضوع : sal_moh85 المنتدى : منتدى المؤشرات و الاكسبيرتات
افتراضي رد: الى استاذ اسلام ارجو المساعده

المشاركة الأصلية كتبت بواسطة sal_moh85 نقره لعرض الصورة في صفحة مستقلة
invalid integer number as parameter 2 for 'iCustom' function
ما معنى هذه الرساله في اكسبيرت وطريقة تصحيحيها وشكرا
،،،تعنى ان هناك خطأ فى المتغير الثانى من الوظيفة iCustom، حاول مراجعة هذه الدالة وتأكد من كتابة كل المتغيرات بطريقة صحيحة،،،



التوقيع

عرض البوم صور اسلام العوامى  
رد مع اقتباس
  #2  
قديم 04-02-2016, 04:15 PM
اسلام العوامى اسلام العوامى غير متواجد حالياً
عضو ذهبى
افتراضي رد: الى استاذ اسلام ارجو المساعده

المشاركة الأصلية كتبت بواسطة sal_moh85 نقره لعرض الصورة في صفحة مستقلة
invalid integer number as parameter 2 for 'iCustom' function
ما معنى هذه الرساله في اكسبيرت وطريقة تصحيحيها وشكرا
،،،تعنى ان هناك خطأ فى المتغير الثانى من الوظيفة iCustom، حاول مراجعة هذه الدالة وتأكد من كتابة كل المتغيرات بطريقة صحيحة،،،




رد مع اقتباس
قديم 04-02-2016, 04:31 PM   المشاركة رقم: 3
الكاتب
sal_moh85
عضو جديد

البيانات
تاريخ التسجيل: Dec 2012
رقم العضوية: 12726
العمر: 38
المشاركات: 115
بمعدل : 0.03 يوميا

الإتصالات
الحالة:
sal_moh85 غير متواجد حالياً
وسائل الإتصال:

كاتب الموضوع : sal_moh85 المنتدى : منتدى المؤشرات و الاكسبيرتات
افتراضي رد: الى استاذ اسلام ارجو المساعده

مشكور
if ((iCustom(NULL, NULL, "mohamad",180,1,5,0,2) > 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,0,1) > 0))
هذه الداله اين الخطاء
الموشر يعتمد على وقتين الخمس دقائق ودقيقه



عرض البوم صور sal_moh85  
رد مع اقتباس
  #3  
قديم 04-02-2016, 04:31 PM
sal_moh85 sal_moh85 غير متواجد حالياً
عضو جديد
افتراضي رد: الى استاذ اسلام ارجو المساعده

مشكور
if ((iCustom(NULL, NULL, "mohamad",180,1,5,0,2) > 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,0,1) > 0))
هذه الداله اين الخطاء
الموشر يعتمد على وقتين الخمس دقائق ودقيقه




رد مع اقتباس
قديم 04-02-2016, 05:07 PM   المشاركة رقم: 4
الكاتب
اسلام العوامى
عضو ذهبى
الصورة الرمزية اسلام العوامى

البيانات
تاريخ التسجيل: Apr 2012
رقم العضوية: 9148
الدولة: alexandria - egypt
المشاركات: 6,086
بمعدل : 1.39 يوميا

الإتصالات
الحالة:
اسلام العوامى غير متواجد حالياً
وسائل الإتصال:

كاتب الموضوع : sal_moh85 المنتدى : منتدى المؤشرات و الاكسبيرتات
افتراضي رد: الى استاذ اسلام ارجو المساعده

المشاركة الأصلية كتبت بواسطة sal_moh85 نقره لعرض الصورة في صفحة مستقلة
مشكور
if ((iCustom(NULL, NULL, "mohamad",180,1,5,0,2) > 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,0,1) > 0))
هذه الداله اين الخطاء
الموشر يعتمد على وقتين الخمس دقائق ودقيقه
،،،فى هذه الحالة لا يبدو ان بها خطأ ، ارفق الكود كامل لفحصة،،،



التوقيع

عرض البوم صور اسلام العوامى  
رد مع اقتباس
  #4  
قديم 04-02-2016, 05:07 PM
اسلام العوامى اسلام العوامى غير متواجد حالياً
عضو ذهبى
افتراضي رد: الى استاذ اسلام ارجو المساعده

المشاركة الأصلية كتبت بواسطة sal_moh85 نقره لعرض الصورة في صفحة مستقلة
مشكور
if ((iCustom(NULL, NULL, "mohamad",180,1,5,0,2) > 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,0,1) > 0))
هذه الداله اين الخطاء
الموشر يعتمد على وقتين الخمس دقائق ودقيقه
،،،فى هذه الحالة لا يبدو ان بها خطأ ، ارفق الكود كامل لفحصة،،،




رد مع اقتباس
قديم 04-02-2016, 05:26 PM   المشاركة رقم: 5
الكاتب
sal_moh85
عضو جديد

البيانات
تاريخ التسجيل: Dec 2012
رقم العضوية: 12726
العمر: 38
المشاركات: 115
بمعدل : 0.03 يوميا

الإتصالات
الحالة:
sal_moh85 غير متواجد حالياً
وسائل الإتصال:

كاتب الموضوع : sal_moh85 المنتدى : منتدى المؤشرات و الاكسبيرتات
افتراضي رد: الى استاذ اسلام ارجو المساعده


#property link "sal_moh85@hotmail.com"

#include <stdlib.mqh>
#include <WinUser32.mqh>

// exported variables
extern double Lots = 1;
extern int Stoploss = 30;
extern int Takeprofit = 50;
extern int TrailingStop14 = 12;
extern int NewTakeProfit14 = 30;
extern int TrailingGap14 = 7;


// local variables
double PipValue=1; // this variable is here to support 5-digit brokers
bool Terminated = false;
string LF = "\n"; // use this in custom or utility blocks where you need line feeds
int NDigits = 4; // used mostly for NormalizeDouble in Flex type blocks
int ObjCount = 0; // count of all objects created on the chart, allows creation of objects with unique names
int current = 0;



int init()
{
NDigits = Digits;

ObjectsDeleteAll(); // clear the chart


Comment(""); // clear the chart
}

// Expert start
int start()
{
if (Bars < 10)
{
Comment("Not enough bars");
return (0);
}
if (Terminated == true)
{
Comment("EA Terminated.");
return (0);
}

OnEveryTick26();

}

void OnEveryTick26()
{
if (true == false && true) PipValue = 10;
if (true && (NDigits == 3 || NDigits == 5)) PipValue = 10;

TechnicalAnalysis30();
TechnicalAnalysis27();
TechnicalAnalysis22();
TechnicalAnalysis37();
TechnicalAnalysis39();
TrailingStop14();
TechnicalAnalysis35();

}

void TechnicalAnalysis30()
{
if (iRSI(NULL, NULL,14,PRICE_CLOSE,1) < 50)
{
TechnicalAnalysis29();

}
}

void TechnicalAnalysis29()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) > 20)
{
TechnicalAnalysis2x38();

}
}

void TechnicalAnalysis2x38()
{
if ((iCustom(NULL, NULL, "mohamad",180,1,5,1,current+2) < 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,1,current+1) > 0))
{
IfOrderDoesNotExist7();

}
}

void IfOrderDoesNotExist7()
{
bool exists = false;
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
exists = true;
}
}
else
{
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));
}

if (exists == false)
{
SellOrder33();

}
}

void SellOrder33()
{
double SL = Bid + Stoploss*PipValue*Point;
if (Stoploss == 0) SL = 0;
double TP = Bid - Takeprofit*PipValue*Point;
if (Takeprofit == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 4, 0, 0, "My Expert", 1, 0, Red);
else
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 4, SL, TP, "My Expert", 1, 0, Red);
if (ticket > -1)
{
if (true)
{
OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Red);
if (ret == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}

}
else
{
Print("OrderSend() error - ", ErrorDescription(GetLastError()));
}
}

void TechnicalAnalysis27()
{
if (iRSI(NULL, NULL,14,PRICE_CLOSE,1) > 50)
{
TechnicalAnalysis28();

}
}

void TechnicalAnalysis28()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) > 20)
{
TechnicalAnalysis2x34();

}
}

void TechnicalAnalysis2x34()
{
if ((iCustom(NULL, NULL, "mohamad",180,1,5,0,current+2) > 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,0,current+1) > 0))
{
IfOrderDoesNotExist31();

}
}

void IfOrderDoesNotExist31()
{
bool exists = false;
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
exists = true;
}
}
else
{
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));
}

if (exists == false)
{
BuyOrder32();

}
}

void BuyOrder32()
{
double SL = Ask - Stoploss*PipValue*Point;
if (Stoploss == 0) SL = 0;
double TP = Ask + Takeprofit*PipValue*Point;
if (Takeprofit == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 4, 0, 0, "My Expert", 1, 0, Blue);
else
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 4, SL, TP, "My Expert", 1, 0, Blue);
if (ticket > -1)
{
if (true)
{
OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Blue);
if (ret == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}

}
else
{
Print("OrderSend() error - ", ErrorDescription(GetLastError()));
}
}

void TechnicalAnalysis22()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) < 20)
{
CloseOrder8();

}
}

void CloseOrder8()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_SELL || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TechnicalAnalysis37()
{
if (iCustom(NULL, NULL, "mohamad",180,1,5,0,current+1) > 0)
{
CloseOrder9();

}
}

void CloseOrder9()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_SELL || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TechnicalAnalysis39()
{
if (iCustom(NULL, NULL, "mohamad",180,1,5,1,current+1) < 0)
{
CloseOrder36();

}
}

void CloseOrder36()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TrailingStop14()
{
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
double takeprofit = OrderTakeProfit();

if (OrderType() == OP_BUY && Ask - OrderOpenPrice() > TrailingStop14*PipValue*Point)
{
if (OrderStopLoss() < Ask-(TrailingStop14+TrailingGap14)*PipValue*Point)
{
if (NewTakeProfit14 != 0) takeprofit = Ask+(NewTakeProfit14 + TrailingStop14)*PipValue*Point;
bool ret1 = OrderModify(OrderTicket(), OrderOpenPrice(), Ask-TrailingStop14*PipValue*Point, takeprofit, OrderExpiration(), White);
if (ret1 == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}
}
if (OrderType() == OP_SELL && OrderOpenPrice() - Bid > TrailingStop14*PipValue*Point)
{
if (OrderStopLoss() > Bid+(TrailingStop14+TrailingGap14)*PipValue*Point)
{
if (NewTakeProfit14 != 0) takeprofit = Bid-(NewTakeProfit14 + TrailingStop14)*PipValue*Point;
bool ret2 = OrderModify(OrderTicket(), OrderOpenPrice(), Bid+TrailingStop14*PipValue*Point, takeprofit, OrderExpiration(), White);
if (ret2 == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}
}
}
}
else
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));

}

void TechnicalAnalysis35()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) < 20)
{
CloseOrder25();

}
}

void CloseOrder25()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}



int deinit()
{
if (false) ObjectsDeleteAll();


}



عرض البوم صور sal_moh85  
رد مع اقتباس
  #5  
قديم 04-02-2016, 05:26 PM
sal_moh85 sal_moh85 غير متواجد حالياً
عضو جديد
افتراضي رد: الى استاذ اسلام ارجو المساعده


#property link "sal_moh85@hotmail.com"

#include <stdlib.mqh>
#include <WinUser32.mqh>

// exported variables
extern double Lots = 1;
extern int Stoploss = 30;
extern int Takeprofit = 50;
extern int TrailingStop14 = 12;
extern int NewTakeProfit14 = 30;
extern int TrailingGap14 = 7;


// local variables
double PipValue=1; // this variable is here to support 5-digit brokers
bool Terminated = false;
string LF = "\n"; // use this in custom or utility blocks where you need line feeds
int NDigits = 4; // used mostly for NormalizeDouble in Flex type blocks
int ObjCount = 0; // count of all objects created on the chart, allows creation of objects with unique names
int current = 0;



int init()
{
NDigits = Digits;

ObjectsDeleteAll(); // clear the chart


Comment(""); // clear the chart
}

// Expert start
int start()
{
if (Bars < 10)
{
Comment("Not enough bars");
return (0);
}
if (Terminated == true)
{
Comment("EA Terminated.");
return (0);
}

OnEveryTick26();

}

void OnEveryTick26()
{
if (true == false && true) PipValue = 10;
if (true && (NDigits == 3 || NDigits == 5)) PipValue = 10;

TechnicalAnalysis30();
TechnicalAnalysis27();
TechnicalAnalysis22();
TechnicalAnalysis37();
TechnicalAnalysis39();
TrailingStop14();
TechnicalAnalysis35();

}

void TechnicalAnalysis30()
{
if (iRSI(NULL, NULL,14,PRICE_CLOSE,1) < 50)
{
TechnicalAnalysis29();

}
}

void TechnicalAnalysis29()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) > 20)
{
TechnicalAnalysis2x38();

}
}

void TechnicalAnalysis2x38()
{
if ((iCustom(NULL, NULL, "mohamad",180,1,5,1,current+2) < 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,1,current+1) > 0))
{
IfOrderDoesNotExist7();

}
}

void IfOrderDoesNotExist7()
{
bool exists = false;
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
exists = true;
}
}
else
{
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));
}

if (exists == false)
{
SellOrder33();

}
}

void SellOrder33()
{
double SL = Bid + Stoploss*PipValue*Point;
if (Stoploss == 0) SL = 0;
double TP = Bid - Takeprofit*PipValue*Point;
if (Takeprofit == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 4, 0, 0, "My Expert", 1, 0, Red);
else
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 4, SL, TP, "My Expert", 1, 0, Red);
if (ticket > -1)
{
if (true)
{
OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Red);
if (ret == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}

}
else
{
Print("OrderSend() error - ", ErrorDescription(GetLastError()));
}
}

void TechnicalAnalysis27()
{
if (iRSI(NULL, NULL,14,PRICE_CLOSE,1) > 50)
{
TechnicalAnalysis28();

}
}

void TechnicalAnalysis28()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) > 20)
{
TechnicalAnalysis2x34();

}
}

void TechnicalAnalysis2x34()
{
if ((iCustom(NULL, NULL, "mohamad",180,1,5,0,current+2) > 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,0,current+1) > 0))
{
IfOrderDoesNotExist31();

}
}

void IfOrderDoesNotExist31()
{
bool exists = false;
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
exists = true;
}
}
else
{
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));
}

if (exists == false)
{
BuyOrder32();

}
}

void BuyOrder32()
{
double SL = Ask - Stoploss*PipValue*Point;
if (Stoploss == 0) SL = 0;
double TP = Ask + Takeprofit*PipValue*Point;
if (Takeprofit == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 4, 0, 0, "My Expert", 1, 0, Blue);
else
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 4, SL, TP, "My Expert", 1, 0, Blue);
if (ticket > -1)
{
if (true)
{
OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Blue);
if (ret == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}

}
else
{
Print("OrderSend() error - ", ErrorDescription(GetLastError()));
}
}

void TechnicalAnalysis22()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) < 20)
{
CloseOrder8();

}
}

void CloseOrder8()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_SELL || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TechnicalAnalysis37()
{
if (iCustom(NULL, NULL, "mohamad",180,1,5,0,current+1) > 0)
{
CloseOrder9();

}
}

void CloseOrder9()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_SELL || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TechnicalAnalysis39()
{
if (iCustom(NULL, NULL, "mohamad",180,1,5,1,current+1) < 0)
{
CloseOrder36();

}
}

void CloseOrder36()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TrailingStop14()
{
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
double takeprofit = OrderTakeProfit();

if (OrderType() == OP_BUY && Ask - OrderOpenPrice() > TrailingStop14*PipValue*Point)
{
if (OrderStopLoss() < Ask-(TrailingStop14+TrailingGap14)*PipValue*Point)
{
if (NewTakeProfit14 != 0) takeprofit = Ask+(NewTakeProfit14 + TrailingStop14)*PipValue*Point;
bool ret1 = OrderModify(OrderTicket(), OrderOpenPrice(), Ask-TrailingStop14*PipValue*Point, takeprofit, OrderExpiration(), White);
if (ret1 == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}
}
if (OrderType() == OP_SELL && OrderOpenPrice() - Bid > TrailingStop14*PipValue*Point)
{
if (OrderStopLoss() > Bid+(TrailingStop14+TrailingGap14)*PipValue*Point)
{
if (NewTakeProfit14 != 0) takeprofit = Bid-(NewTakeProfit14 + TrailingStop14)*PipValue*Point;
bool ret2 = OrderModify(OrderTicket(), OrderOpenPrice(), Bid+TrailingStop14*PipValue*Point, takeprofit, OrderExpiration(), White);
if (ret2 == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}
}
}
}
else
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));

}

void TechnicalAnalysis35()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) < 20)
{
CloseOrder25();

}
}

void CloseOrder25()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}



int deinit()
{
if (false) ObjectsDeleteAll();


}





رد مع اقتباس
قديم 04-02-2016, 05:27 PM   المشاركة رقم: 6
الكاتب
sal_moh85
عضو جديد

البيانات
تاريخ التسجيل: Dec 2012
رقم العضوية: 12726
العمر: 38
المشاركات: 115
بمعدل : 0.03 يوميا

الإتصالات
الحالة:
sal_moh85 غير متواجد حالياً
وسائل الإتصال:

كاتب الموضوع : sal_moh85 المنتدى : منتدى المؤشرات و الاكسبيرتات
افتراضي رد: الى استاذ اسلام ارجو المساعده


#property link "sal_moh85@hotmail.com"

#include <stdlib.mqh>
#include <WinUser32.mqh>

// exported variables
extern double Lots = 1;
extern int Stoploss = 30;
extern int Takeprofit = 50;
extern int TrailingStop14 = 12;
extern int NewTakeProfit14 = 30;
extern int TrailingGap14 = 7;


// local variables
double PipValue=1; // this variable is here to support 5-digit brokers
bool Terminated = false;
string LF = "\n"; // use this in custom or utility blocks where you need line feeds
int NDigits = 4; // used mostly for NormalizeDouble in Flex type blocks
int ObjCount = 0; // count of all objects created on the chart, allows creation of objects with unique names
int current = 0;



int init()
{
NDigits = Digits;

ObjectsDeleteAll(); // clear the chart


Comment(""); // clear the chart
}

// Expert start
int start()
{
if (Bars < 10)
{
Comment("Not enough bars");
return (0);
}
if (Terminated == true)
{
Comment("EA Terminated.");
return (0);
}

OnEveryTick26();

}

void OnEveryTick26()
{
if (true == false && true) PipValue = 10;
if (true && (NDigits == 3 || NDigits == 5)) PipValue = 10;

TechnicalAnalysis30();
TechnicalAnalysis27();
TechnicalAnalysis22();
TechnicalAnalysis37();
TechnicalAnalysis39();
TrailingStop14();
TechnicalAnalysis35();

}

void TechnicalAnalysis30()
{
if (iRSI(NULL, NULL,14,PRICE_CLOSE,1) < 50)
{
TechnicalAnalysis29();

}
}

void TechnicalAnalysis29()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) > 20)
{
TechnicalAnalysis2x38();

}
}

void TechnicalAnalysis2x38()
{
if ((iCustom(NULL, NULL, "mohamad",180,1,5,1,current+2) < 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,1,current+1) > 0))
{
IfOrderDoesNotExist7();

}
}

void IfOrderDoesNotExist7()
{
bool exists = false;
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
exists = true;
}
}
else
{
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));
}

if (exists == false)
{
SellOrder33();

}
}

void SellOrder33()
{
double SL = Bid + Stoploss*PipValue*Point;
if (Stoploss == 0) SL = 0;
double TP = Bid - Takeprofit*PipValue*Point;
if (Takeprofit == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 4, 0, 0, "My Expert", 1, 0, Red);
else
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 4, SL, TP, "My Expert", 1, 0, Red);
if (ticket > -1)
{
if (true)
{
OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Red);
if (ret == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}

}
else
{
Print("OrderSend() error - ", ErrorDescription(GetLastError()));
}
}

void TechnicalAnalysis27()
{
if (iRSI(NULL, NULL,14,PRICE_CLOSE,1) > 50)
{
TechnicalAnalysis28();

}
}

void TechnicalAnalysis28()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) > 20)
{
TechnicalAnalysis2x34();

}
}

void TechnicalAnalysis2x34()
{
if ((iCustom(NULL, NULL, "mohamad",180,1,5,0,current+2) > 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,0,current+1) > 0))
{
IfOrderDoesNotExist31();

}
}

void IfOrderDoesNotExist31()
{
bool exists = false;
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
exists = true;
}
}
else
{
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));
}

if (exists == false)
{
BuyOrder32();

}
}

void BuyOrder32()
{
double SL = Ask - Stoploss*PipValue*Point;
if (Stoploss == 0) SL = 0;
double TP = Ask + Takeprofit*PipValue*Point;
if (Takeprofit == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 4, 0, 0, "My Expert", 1, 0, Blue);
else
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 4, SL, TP, "My Expert", 1, 0, Blue);
if (ticket > -1)
{
if (true)
{
OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Blue);
if (ret == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}

}
else
{
Print("OrderSend() error - ", ErrorDescription(GetLastError()));
}
}

void TechnicalAnalysis22()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) < 20)
{
CloseOrder8();

}
}

void CloseOrder8()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_SELL || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TechnicalAnalysis37()
{
if (iCustom(NULL, NULL, "mohamad",180,1,5,0,current+1) > 0)
{
CloseOrder9();

}
}

void CloseOrder9()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_SELL || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TechnicalAnalysis39()
{
if (iCustom(NULL, NULL, "mohamad",180,1,5,1,current+1) < 0)
{
CloseOrder36();

}
}

void CloseOrder36()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TrailingStop14()
{
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
double takeprofit = OrderTakeProfit();

if (OrderType() == OP_BUY && Ask - OrderOpenPrice() > TrailingStop14*PipValue*Point)
{
if (OrderStopLoss() < Ask-(TrailingStop14+TrailingGap14)*PipValue*Point)
{
if (NewTakeProfit14 != 0) takeprofit = Ask+(NewTakeProfit14 + TrailingStop14)*PipValue*Point;
bool ret1 = OrderModify(OrderTicket(), OrderOpenPrice(), Ask-TrailingStop14*PipValue*Point, takeprofit, OrderExpiration(), White);
if (ret1 == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}
}
if (OrderType() == OP_SELL && OrderOpenPrice() - Bid > TrailingStop14*PipValue*Point)
{
if (OrderStopLoss() > Bid+(TrailingStop14+TrailingGap14)*PipValue*Point)
{
if (NewTakeProfit14 != 0) takeprofit = Bid-(NewTakeProfit14 + TrailingStop14)*PipValue*Point;
bool ret2 = OrderModify(OrderTicket(), OrderOpenPrice(), Bid+TrailingStop14*PipValue*Point, takeprofit, OrderExpiration(), White);
if (ret2 == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}
}
}
}
else
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));

}

void TechnicalAnalysis35()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) < 20)
{
CloseOrder25();

}
}

void CloseOrder25()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}



int deinit()
{
if (false) ObjectsDeleteAll();


}



عرض البوم صور sal_moh85  
رد مع اقتباس
  #6  
قديم 04-02-2016, 05:27 PM
sal_moh85 sal_moh85 غير متواجد حالياً
عضو جديد
افتراضي رد: الى استاذ اسلام ارجو المساعده


#property link "sal_moh85@hotmail.com"

#include <stdlib.mqh>
#include <WinUser32.mqh>

// exported variables
extern double Lots = 1;
extern int Stoploss = 30;
extern int Takeprofit = 50;
extern int TrailingStop14 = 12;
extern int NewTakeProfit14 = 30;
extern int TrailingGap14 = 7;


// local variables
double PipValue=1; // this variable is here to support 5-digit brokers
bool Terminated = false;
string LF = "\n"; // use this in custom or utility blocks where you need line feeds
int NDigits = 4; // used mostly for NormalizeDouble in Flex type blocks
int ObjCount = 0; // count of all objects created on the chart, allows creation of objects with unique names
int current = 0;



int init()
{
NDigits = Digits;

ObjectsDeleteAll(); // clear the chart


Comment(""); // clear the chart
}

// Expert start
int start()
{
if (Bars < 10)
{
Comment("Not enough bars");
return (0);
}
if (Terminated == true)
{
Comment("EA Terminated.");
return (0);
}

OnEveryTick26();

}

void OnEveryTick26()
{
if (true == false && true) PipValue = 10;
if (true && (NDigits == 3 || NDigits == 5)) PipValue = 10;

TechnicalAnalysis30();
TechnicalAnalysis27();
TechnicalAnalysis22();
TechnicalAnalysis37();
TechnicalAnalysis39();
TrailingStop14();
TechnicalAnalysis35();

}

void TechnicalAnalysis30()
{
if (iRSI(NULL, NULL,14,PRICE_CLOSE,1) < 50)
{
TechnicalAnalysis29();

}
}

void TechnicalAnalysis29()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) > 20)
{
TechnicalAnalysis2x38();

}
}

void TechnicalAnalysis2x38()
{
if ((iCustom(NULL, NULL, "mohamad",180,1,5,1,current+2) < 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,1,current+1) > 0))
{
IfOrderDoesNotExist7();

}
}

void IfOrderDoesNotExist7()
{
bool exists = false;
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
exists = true;
}
}
else
{
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));
}

if (exists == false)
{
SellOrder33();

}
}

void SellOrder33()
{
double SL = Bid + Stoploss*PipValue*Point;
if (Stoploss == 0) SL = 0;
double TP = Bid - Takeprofit*PipValue*Point;
if (Takeprofit == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 4, 0, 0, "My Expert", 1, 0, Red);
else
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 4, SL, TP, "My Expert", 1, 0, Red);
if (ticket > -1)
{
if (true)
{
OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Red);
if (ret == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}

}
else
{
Print("OrderSend() error - ", ErrorDescription(GetLastError()));
}
}

void TechnicalAnalysis27()
{
if (iRSI(NULL, NULL,14,PRICE_CLOSE,1) > 50)
{
TechnicalAnalysis28();

}
}

void TechnicalAnalysis28()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) > 20)
{
TechnicalAnalysis2x34();

}
}

void TechnicalAnalysis2x34()
{
if ((iCustom(NULL, NULL, "mohamad",180,1,5,0,current+2) > 0) && (iCustom(NULL, NULL, "mohamad",180,1,5,0,current+1) > 0))
{
IfOrderDoesNotExist31();

}
}

void IfOrderDoesNotExist31()
{
bool exists = false;
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
exists = true;
}
}
else
{
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));
}

if (exists == false)
{
BuyOrder32();

}
}

void BuyOrder32()
{
double SL = Ask - Stoploss*PipValue*Point;
if (Stoploss == 0) SL = 0;
double TP = Ask + Takeprofit*PipValue*Point;
if (Takeprofit == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 4, 0, 0, "My Expert", 1, 0, Blue);
else
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 4, SL, TP, "My Expert", 1, 0, Blue);
if (ticket > -1)
{
if (true)
{
OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Blue);
if (ret == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}

}
else
{
Print("OrderSend() error - ", ErrorDescription(GetLastError()));
}
}

void TechnicalAnalysis22()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) < 20)
{
CloseOrder8();

}
}

void CloseOrder8()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_SELL || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TechnicalAnalysis37()
{
if (iCustom(NULL, NULL, "mohamad",180,1,5,0,current+1) > 0)
{
CloseOrder9();

}
}

void CloseOrder9()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_SELL || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TechnicalAnalysis39()
{
if (iCustom(NULL, NULL, "mohamad",180,1,5,1,current+1) < 0)
{
CloseOrder36();

}
}

void CloseOrder36()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}

void TrailingStop14()
{
for (int i=OrdersTotal()-1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderSymbol() == Symbol() && OrderMagicNumber() == 1)
{
double takeprofit = OrderTakeProfit();

if (OrderType() == OP_BUY && Ask - OrderOpenPrice() > TrailingStop14*PipValue*Point)
{
if (OrderStopLoss() < Ask-(TrailingStop14+TrailingGap14)*PipValue*Point)
{
if (NewTakeProfit14 != 0) takeprofit = Ask+(NewTakeProfit14 + TrailingStop14)*PipValue*Point;
bool ret1 = OrderModify(OrderTicket(), OrderOpenPrice(), Ask-TrailingStop14*PipValue*Point, takeprofit, OrderExpiration(), White);
if (ret1 == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}
}
if (OrderType() == OP_SELL && OrderOpenPrice() - Bid > TrailingStop14*PipValue*Point)
{
if (OrderStopLoss() > Bid+(TrailingStop14+TrailingGap14)*PipValue*Point)
{
if (NewTakeProfit14 != 0) takeprofit = Bid-(NewTakeProfit14 + TrailingStop14)*PipValue*Point;
bool ret2 = OrderModify(OrderTicket(), OrderOpenPrice(), Bid+TrailingStop14*PipValue*Point, takeprofit, OrderExpiration(), White);
if (ret2 == false)
Print("OrderModify() error - ", ErrorDescription(GetLastError()));
}
}
}
}
else
Print("OrderSelect() error - ", ErrorDescription(GetLastError()));

}

void TechnicalAnalysis35()
{
if (iADX(NULL, NULL,9,PRICE_CLOSE,MODE_MAIN,1) < 20)
{
CloseOrder25();

}
}

void CloseOrder25()
{
int orderstotal = OrdersTotal();
int orders = 0;
int ordticket[90][2];
for (int i = 0; i < orderstotal; i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 1)
{
continue;
}
ordticket[orders][0] = OrderOpenTime();
ordticket[orders][1] = OrderTicket();
orders++;
}
if (orders > 1)
{
ArrayResize(ordticket,orders);
ArraySort(ordticket);
}
for (i = 0; i < orders; i++)
{
if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
{
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
}
}

}



int deinit()
{
if (false) ObjectsDeleteAll();


}





رد مع اقتباس
قديم 04-02-2016, 05:28 PM   المشاركة رقم: 7
الكاتب
sal_moh85
عضو جديد

البيانات
تاريخ التسجيل: Dec 2012
رقم العضوية: 12726
العمر: 38
المشاركات: 115
بمعدل : 0.03 يوميا

الإتصالات
الحالة:
sal_moh85 غير متواجد حالياً
وسائل الإتصال:

كاتب الموضوع : sal_moh85 المنتدى : منتدى المؤشرات و الاكسبيرتات
افتراضي رد: الى استاذ اسلام ارجو المساعده

هاد الكود



عرض البوم صور sal_moh85  
رد مع اقتباس
  #7  
قديم 04-02-2016, 05:28 PM
sal_moh85 sal_moh85 غير متواجد حالياً
عضو جديد
افتراضي رد: الى استاذ اسلام ارجو المساعده

هاد الكود




رد مع اقتباس
إضافة رد

مواقع النشر (المفضلة)

الكلمات الدلالية (Tags)
المساعده, ارجو, اسماء, استاذ

أدوات الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة



الساعة الآن 11:24 PM



جميع الحقوق محفوظة الى اف اكس ارابيا www.fx-arabia.com

تحذير المخاطرة

التجارة بالعملات الأجنبية تتضمن علي قدر كبير من المخاطر ومن الممكن ألا تكون مناسبة لجميع المضاربين, إستعمال الرافعة المالية في التجاره يزيد من إحتمالات الخطورة و التعرض للخساره, عليك التأكد من قدرتك العلمية و الشخصية على التداول.

تنبيه هام

موقع اف اكس ارابيا هو موقع تعليمي خالص يهدف الي توعية المستثمر العربي مبادئ الاستثمار و التداول الناجح ولا يتحصل علي اي اموال مقابل ذلك ولا يقوم بادارة محافظ مالية وان ادارة الموقع غير مسؤولة عن اي استغلال من قبل اي شخص لاسمها وتحذر من ذلك.

اتصل بنا

البريد الإلكتروني للدعم الفنى : support@fx-arabia.com
جميع الحقوق محفوظة اف اكس ارابيا – احدى مواقع Inwestopedia Sp. Z O.O. للاستشارات و التدريب – جمهورية بولندا الإتحادية.
Powered by vBulletin® Copyright ©2000 - 2024 , Designed by Fx-Arabia Team