Orders Execution
0
Views
0
Downloads
0
Favorites
VR---RIF
//=============================================
//Ïî âîïðîñàì çàêàçà ñîâåòíèêîâ îáðàùàòüñÿ íà
// ICQ 155553959
//=============================================
extern string ÍÀÑÒÐÎÉÊÈ= "Ãëàâíûå íàñòðîéêè" ;
extern int Slip = 50 ;
extern int MagicNumber = 227 ;
extern double Lots = 0.1 ;
//=============================================
extern int FastEMA =15 ;
extern int SlowEMA =45 ;
extern int RSIPeriod =3 ;
//=============================================
int t1,t2 ;
int start () {
//=================================================================================
double SID1 = iMA (NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,0);
double SID2 = iMA (NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,0);
double RSIS = iRSI (NULL,0,RSIPeriod, PRICE_CLOSE, 0);
//=================================================================================
//ÍÀ×ÀËÎ
//=================================================================================
int siup=0;
int sidw=0;
double pipdiffCurrent=SID1-SID2;
if (pipdiffCurrent>0 && RSIS>50)
{siup = 1; }
else
if (pipdiffCurrent<0 && RSIS<50)
{sidw = 1; }
//=================================================================================
//=================================================================================
if (OrdersTotal() == 0)
{
if(siup==1)
{
//===============================================================================================================================//
t1=OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask,Digits),Slip,0,0,NULL,MagicNumber,0,CLR_NONE);
}
if(sidw==1)
{
t2=OrderSend(Symbol(),OP_SELL,Lots,NormalizeDouble(Bid,Digits),Slip,0,0,NULL,MagicNumber,0,CLR_NONE);
}
}
//===============================================================================================================================//
if (OrdersTotal() == 1)
{
if(siup==1)
{
//===============================================================================================================================//
if(t2>0)
{
OrderClose(t2,Lots,Ask,Slip,Red);
}
}
if(sidw==1)
{
if(t1>0)
{
OrderClose(t1,Lots,Bid,Slip,Red);
}
}
}
return(0);}
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---