← Назад к списку файлов

forexstay sight.mq4

Поиск по коду файла

#property strict 

extern string Copyright = "FOREXSTAY SIGHT - FOREXSTAY.COM";
extern int SightSystem = 1;
extern bool UseMM = TRUE;
extern double Risk= 10.0;
extern double FixedLots = 0.01;  
extern int MaxLots= 1000;
extern int MaxOrders=100;   
extern double MaxSpread = 5.0;
extern int Slippage = 3;

int Rtyy_276;
int Rtyy_284;
int Rtyy_292;
int Rtyy_300;
double Rtyy_308;
int Rtyy_312 = 3;
double Rtyy_316;
int Rtyy_320;
int Rtyy_324;
string Rtyy_260;
string Rtyy_268;
string Rtyy_298;
int Rtyy_306;

int m;
int s;
int c;
int sd;

int  OpenOrders=0, cnt=0;
double sl=0, tp=0;
double BuyPrice=0, SellPrice=0;
double lotsi=0, mylotsi=0;
int mode=0, myOrderType=0;
bool ContinueOpening=True;
double LastPrice=0;
int  PreviousOpenOrders=0;
double Profit=0;
int LastTicket=0, LastType=0;
double LastClosePrice=0, LastLots=0;
double Pivot=0;
double PipValue=0;
string text="", text2="";
 int    MAGIC=12457814;
 double TakeProfit = 30;         
 double InitialStop = 90;      
 double TrailingStop = 15;       
 int Pips=4;                   
 int SecureProfit=50;        
 int OrderstoProtect=3;          
 int ReverseCondition=0;        
 int SlowEMA=26;    
 int SignalEMA = 9;
 int mm=0;                    
 int AccountisNormal=0;         
 double Doble=1.5;           
 double USDCHFPipValue=10.5;    
 double USDCADPipValue=10.4;     
 double USDJPYPipValue=9.2;      
 double EURJPYPipValue=9.8;      
  double EURUSDPipValue=10.3;     
 double GBPUSDPipValue=10;       
 double AUDUSDPipValue=9.9;     
 double NZDUSDPipValue=8.9;      
 int FastEMA;
int init()
  {
      // код доступен только после оплаты
   }
int deinit()
  {
   return(0);
  }
int start()
  {
      // код доступен только после оплаты
   }
   if (AccountisNormal==1)
   {
	  if (mm!=0) { lotsi=MathCeil(AccountBalance()*Risk/10000); }
		else { lotsi=FixedLots; }
   } else {  // then is mini
    if (mm!=0) { lotsi=MathCeil(AccountBalance()*Risk/10000)/10; }
		else { lotsi=FixedLots; }
   }

   if (lotsi>MaxLots){ lotsi=MaxLots; }

   OpenOrders=0;
   for(cnt=0;cnt<OrdersTotal();cnt++)   
   {
     s=OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
	  if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC)
	  {				
	  	  OpenOrders++;
	  }
   }     

   if (OpenOrders<1) 
   if (Symbol()=="USDCHF") { PipValue=USDCHFPipValue; }
   if (Symbol()=="USDCAD") { PipValue=USDCADPipValue; }
   if (Symbol()=="USDJPY") { PipValue=USDJPYPipValue; }
   if (Symbol()=="EURJPY") { PipValue=EURJPYPipValue; }
   if (Symbol()=="EURUSD") { PipValue=EURUSDPipValue; }
   if (Symbol()=="GBPUSD") { PipValue=GBPUSDPipValue; }
   if (Symbol()=="AUDUSD") { PipValue=AUDUSDPipValue; }
   if (Symbol()=="NZDUSD") { PipValue=NZDUSDPipValue; }
   if (PipValue==0) { PipValue=5; }

   if (PreviousOpenOrders>OpenOrders) 
   {	  
	  for(cnt=OrdersTotal();cnt>=0;cnt--)
	  {
	     s=OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
		  if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) 
		  {
	  	   mode=OrderType();
			if (mode==OP_BUY) { c=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,Blue); }
			if (mode==OP_SELL) { c=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,Red); }
			return(0);
		 }
	  }
   }

   PreviousOpenOrders=OpenOrders;
   if (OpenOrders>=MaxOrders) 
   {
	  ContinueOpening=False;
   } else {
	  ContinueOpening=True;
   }

   if (LastPrice==0) 
   {
	  for(cnt=0;cnt<OrdersTotal();cnt++)
	  {	
	    s=OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
		 if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) 
		 {
		   mode=OrderType();	
			LastPrice=OrderOpenPrice();
			if (mode==OP_BUY) { myOrderType=2; }
			if (mode==OP_SELL) { myOrderType=1;	}
		 }
	  }
   }

   if (OpenOrders<1) 
   {
	  myOrderType=3;
	  if(iCustom(NULL,0,"ZeroLag MACD",FastEMA,SlowEMA,SignalEMA,0,0)
	  >iCustom(NULL,0,"ZeroLag MACD",FastEMA,SlowEMA,SignalEMA,0,1)) myOrderType=2;
	  if(iCustom(NULL,0,"ZeroLag MACD",FastEMA,SlowEMA,SignalEMA,0,0)
	  <iCustom(NULL,0,"ZeroLag MACD",FastEMA,SlowEMA,SignalEMA,0,1)) myOrderType=1;
	  if (ReverseCondition==1)
	  {
	  	  if (myOrderType==1) { myOrderType=2; }
		  else { if (myOrderType==2) { myOrderType=1; } }
	  }
   }

   for(cnt=OrdersTotal();cnt>=0;cnt--)
   {
     s=OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES

Показано первые 50% кода (символов: 6423)

Как получить полную версию?

Введите ваш email и нажмите кнопку, чтобы перейти к оплате.