//+------------------------------------------------------------------+ //| Trade Manager Test.mq4 | //| . | //| | //+------------------------------------------------------------------+ //#property copyright "Copyright 2020, MetaQuotes Software Corp." //#property link "mystik5551@gmail.com" #property version "1.00" #property strict input double lots =0.1; input int stoploss= 30; input int takeprofit= 40; input int magic1=302; input int slippage= 3; input double lotfactor= 0.50; input int totalorders=8; input int EnterHour =4; //+------------------------------------------------------------------+ void openbuy() { OrderSend(Symbol(), OP_BUY,lots,Ask, slippage, Ask-stoploss*Point,Ask+takeprofit*Point,"Buy Trade",magic1,0,Blue); lots+=lotfactor; } void openbuystop() { int ticket, expiration; double point; //---- point=MarketInfo(Symbol(),MODE_POINT); expiration=NULL; double price = Ask+50*Point; //---- while(true) { ticket= OrderSend(Symbol(), OP_BUYSTOP,lots,price,0, 0,price+takeprofit*Point,"BuyStop Trade",magic1,expiration,Green); if(ticket<=0)Print("Error = ", GetLastError()); else{Print("ticket = ", ticket); break; } //---- 10 seconds wait Sleep(10000); } lots+=lotfactor; } void opensell() { OrderSend(Symbol(), OP_SELL,lots,Bid-50*Point, slippage, Bid+stoploss*Point,Bid-takeprofit*Point,"Sell Trade",magic1,Red); lots+=lotfactor; } void opensellstop() { int ticket, expiration; double point; //---- point=MarketInfo(Symbol(),MODE_POINT); expiration=NULL; double price = Bid-50*Point; //---- while(true) { ticket= OrderSend(Symbol(), OP_SELLSTOP,lots,price,0, 0,price-takeprofit*Point,"SellStop Trade",magic1,expiration,Pink); if(ticket<=0)Print("Error = ", GetLastError()); else{Print("ticket = ", ticket); break; } //---- 10 seconds wait Sleep(10000); } lots+=lotfactor; } int countpending() { int s=0; for(int i=0;i OP_SELL) { s++; } } return(s); } void closeallorders() { for(int i=0;i