//+------------------------------------------------------------------+ //| SMF.mq4 | //| someone@some.com | //| somethere.com | //+------------------------------------------------------------------+ #property copyright "someone@some.com" #property link "somethere.com" //---- input parameters extern double lot; extern int prof; extern int loss; int S11; int K11 = 1; int Z11; double Signal; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ void init() { Alert("Советник запущен") return; } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ void deinit() { Alert("Советник отключен") return; } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ void start() { for (int i=1; i= 80) { OrderSend (Symbol(),OP_SELL,lot*K11,Bid,3,Bid+loss*Point,Bid-prof*Point,NULL,9753,0); // Продажа } if (Signal < 20) { OrderSend (Symbol(),OP_BUY,lot*K11,Ask,3,Ask-loss*Point,Ask+prof*Point,NULL,9753,0); // Покупка } if (Signal > 20||Signal < 80) { if (Z11==1) // Если ордер закрыт по стопу { if (S11==0) // Если закрытый ордер был на продажу { OrderSend (Symbol(),OP_BUY,lot*K11,Ask,3,Ask-loss*Point,Ask+prof*Point,NULL,9753,0) // Покупка S11 = 1 Z11 = 0 } if (S11==1) // Если закрытый ордер был на покупку { OrderSend (Symbol(),OP_SELL,lot*K11,Bid,3,Bid+loss*Point,Bid-prof*Point,NULL,9753,0) // Продажа S11 = 0 Z11 = 0 } } } //+------------------------------------------------------------------+