//+------------------------------------------------------------------+ //| test.mq4 | //| Copyright © 2009, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property show_inputs #include extern int MaxRisk=2; extern bool Buy=false; //для открытия ордера на покупку extern bool Sell=false; //для открытия ордера на продажу extern int TakeProfit=100; extern int StopLoss=100; //+------------------------------------------------------------------+ int start() {double Lot=GetLot(MaxRisk); if(Lot==0) {Alert("Недостаточно средств!");return(0);} RefreshRates(); if(Buy) NewOrder(OP_BUY,Lot,0,0,0); if(Sell) NewOrder(OP_SELL,Lot,0,0,0); return(0);} //+------------------------------------------------------------------+