1 مرفق
صاحب قرار (2) rsi --مؤشر القوة النسبيية على audcad-ربع ساعة
بسم الله الرحيم الرحيم
في موضوع مستقل في القسم العام قلنا هو الزوج الوحيد اتلذي قد ينجح معه اي شيء
اسفل اخر 7 شهور!
الكود مقتوح--يعني مافيه ملح مجالس :) زي فلان وفلان
=
https://forum.arabictrader.com/attac...1&d=1516537590
=
=
كود PHP:
int setTimerUpdate=1;
int RSI_PERIOD=14;
int RSI_UP_TREND=63;
double Lots=0.1;
int TP=5000;
int SL=5000;
int t;
datetime New_Time=0;
int b=0;
int s=0;
int bX=0;
int sX=0;
int set=0;
int setX=0;
int b1=0;
int s1=0;
int b11=0;
int s11=0;
int bX1=0;
int sX1=0;
bool ticket;;
/////////////////////////////////////////////////////////////////////////////////////////////////
void OnTick()
{//zz
int RSI_DOWN_TREND=100-RSI_UP_TREND;
if(New_Time!=Time[0])
{//yy
New_Time=Time[0];
t++; int sh=0;
/////////////////////////////////////////////////////////////////////////////////////////////////
double M1,M2;
/////////////////////////////////////////////////////////////////////////////////////////////////
M1 = iRSI(NULL, 0, RSI_PERIOD, PRICE_CLOSE, 1+sh );
M2 = iRSI(NULL, 0, RSI_PERIOD, PRICE_CLOSE, 2+sh );
/////////////////////////////////////////////////////////////////////////////////////////////////
if((M1>RSI_DOWN_TREND && M2<RSI_DOWN_TREND) && t>0)
{
b1++;
s1=0;
if(b1>=set)
{
ticket=OrderSend(NULL, OP_BUY, b*Lots , MarketInfo(NULL,MODE_ASK) , 10 , 0 , 0, "RSI-BUY-50 UP-"+Period() , 0 , 0 , clrLime);
t=0;
s=1;
b++;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
if((M1<RSI_UP_TREND && M2>RSI_UP_TREND) && t>0)
{
s1++;
b1=0;
if(s1>=set)
{
ticket=OrderSend(NULL, OP_SELL, s*Lots , MarketInfo(NULL,MODE_BID) , 10 , 0, 0, "RSI-SELL-50 DOWN-"+Period() , 0 , 0 , clrRed);
t=0;
b=1;
s++;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
if((M2>RSI_UP_TREND && M1<RSI_UP_TREND))
{//0
for(int j=OrdersTotal();j>-1;j--)
{//1
if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES))
{//2
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(OrderType()==OP_BUY)
{//6
ticket=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),10,clrAqua);
}//6
}//2
}//1
}//0
////////////////
if((M2<RSI_DOWN_TREND && M1>RSI_DOWN_TREND))
{//0
for(j=OrdersTotal();j>-1;j--)
{//1
if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES))
{//2
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(OrderType()==OP_SELL)
{//6
ticket=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),0,clrOrange);
}//6
}//2
}//1
}//0
}//yy
}//zz
//////////////////////////////////////////////////////////////////////////////////////////////////
int OnInit()
{
if(setTimerUpdate<1)setTimerUpdate=1;
EventSetTimer(setTimerUpdate);
return(INIT_SUCCEEDED);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void OnDeinit(const int reason)
{
EventKillTimer();
//ObjectsDeleteAll();
}
//////////////////////////////////////////////////////////////////////////////////////////////////