Guest User

Untitled

a guest
Nov 5th, 2013
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1.  
  2. //| Copyright © 2004, MetaQuotes Software Corp. |
  3.  
  4. //| http://www.metaquotes.net/ |
  5.  
  6. //+------------------------------------------------------------------+
  7.  
  8. #property copyright "Copyright © 2004, MetaQuotes Software Corp."
  9.  
  10. #property link "http://www.metaquotes.net/"
  11.  
  12. #property show_confirm
  13.  
  14.  
  15.  
  16. //+------------------------------------------------------------------+
  17.  
  18. //| script "send pending order with expiration data" |
  19.  
  20. //+------------------------------------------------------------------+
  21.  
  22. int start()
  23.  
  24. {
  25.  
  26. int ticket,expiration;
  27.  
  28. double point;
  29.  
  30. //----
  31.  
  32. point=MarketInfo(Symbol(),MODE_POINT);
  33.  
  34. expiration=CurTime()+PERIOD_D1*60;
  35.  
  36. //----
  37.  
  38. while(true)
  39.  
  40. {
  41.  
  42. ticket=OrderSend(Symbol(),OP_SELLSTOP,1.0,Bid-30*point,0,0,0,"some comment",16384,expiration,Green);
  43.  
  44. if(ticket<=0) Print("Error = ",GetLastError());
  45.  
  46. else { Print("ticket = ",ticket); break; }
  47.  
  48. //---- 10 seconds wait
  49.  
  50. Sleep(10000);
  51.  
  52. }
  53.  
  54. //----
  55.  
  56. return(0);
  57.  
  58. }
  59.  
  60. //+------------------------------------------------------------------+
Advertisement
Add Comment
Please, Sign In to add comment