اخي الكريم اسلام
انا فكرتى هى وضع تعطيل لخاصية قراءة الاكسبيرت لهيستورى بحيث عند تشغيل الاكسبيرت ينفذ صفقه فورا حسب الاشارة الحالية
و بعد ذلك يمكنني تفعيل هذه الخاصية والذهاب الى عملى مطمئناً حسب الاشارة الجديده عند حدوثها لان الاشارة هى عبارة عن تقاطع
وهذا هو الكود
كود:
static datetime LastBarTraded = 0;
static int prevtime = 0;//Do not use when 0-bar is used
double Poin;
int digits;
double SL;
double TP;
int i ;
string last_sell_time="LastOrderTimeSell";//***************************************
string last_buy_time ="LastOrderTimeBuy";//***************************************
extern bool Auto_Close=true;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
if (Point == 0.00001) Poin = 0.0001;
else
if (Point == 0.001) Poin = 0.01;
else
Poin = Point;
//----
if (Digits == 5) digits = 4;
else
if (Digits == 3) digits = 2;
else
digits = Digits;
//----
//----
last_sell_time=last_sell_time+AccountNumber()+Symbol();//***************************************
last_buy_time=last_buy_time+AccountNumber()+Symbol();//***************************************
if(IsTesting())//***************************************
//***************************************
GlobalVariableSet(last_sell_time,0);//***************************************
GlobalVariableSet(last_buy_time,0);//******
return(0);
}
//---------------------------------------
int LastOrdertype(){
for(int i=OrdersHistoryTotal();i>0;i--){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES); /// MODE_HISTORY
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber){
return(OrderType());
}
}
return(2);
}
هل يمكن تعديل هذا الكود حسب ما اريده ان يكون
او لابد من وضع اكستيرن ل LastOrdertype True Or False
او ل OrdersHistoryTotal True or False
اذا كان جميع ما ذكرته لا يمكن التطبيق و لديك حلول اكون لك شاكرا في كل الاحوال