VR---STEALS

Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It can change open orders parameters, due to possible stepping strategy
0 Views
0 Downloads
0 Favorites
VR---STEALS
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
#property link      "http://traders-union.ru/?ref=25250"            //
//                       ÂÍÈÌÀÍÈÅ                                   //
//Äëÿ ïàðòíåðîâ ãðóïïû â "ÌÎÔÒ" (Ìåæäóíàðîäíîå Îáüåäåíåíèå          //
//Ôîðêñ Òðåéäåðîâ) ïèøó ñîâåòíèêè áåñïëàòíî è ïðåäëàãàþ íåñêîëüêî   //
//ðàáî÷èõ âàðèàíòîâ. Ñêàéï Voldemar227  ICQ 155553959               //
//////////////////////////////////////////////////////////////////////
extern string ÌÎÔÒ       = "http://traders-union.ru/?ref=25250";
extern int    TakeProfit      = 70           ;
extern int    StopLoss        = 50           ;
extern int    Tral            = 15           ;
extern int    Slip            = 3            ;
int start ()                                  {
double TP=NormalizeDouble(TakeProfit*Point,Digits);
double SL  =NormalizeDouble(StopLoss  *Point,Digits);
double TR =NormalizeDouble(Tral*Point,Digits);
   int total=OrdersTotal();                  
   int b=0, s=0, vsego=0;               
   for (int i=total-1; i>=0; i--)               
   {
    if(OrderSelect(i, SELECT_BY_POS))                        
    {
    if(OrderSymbol()!=Symbol())continue;                        
     {
//===================================================================//     
     if (OrderType()==OP_BUY)                                
     {b++;                   
      double  opb=OrderOpenPrice(); 
      double  prib=OrderStopLoss();
      double red = opb+TP;
      double wer = opb-SL;
      if (Ask>red||Bid<wer)
      {
      OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),Slip,Red);
      } 
      if( Bid>opb+TR&&prib==0) 
      {
      OrderModify(OrderTicket(),OrderOpenPrice(), opb+0.0001, OrderTakeProfit(), 0);
     
      }     
      if( Bid>prib+TR&&prib>opb)                           
      {
      OrderModify(OrderTicket(),OrderOpenPrice(), Bid - TR, OrderTakeProfit(), 0);        
      } 
      }
//=================================================================================================//
    if (OrderType()==OP_SELL)                       
     {s++;                   
      double  ops=OrderOpenPrice(); 
      double  pris=OrderStopLoss();
      double rid = ops-TP;
      double wir = ops+SL;
      if (Bid>wir||Ask<rid)
      {
      OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Ask,Digits),Slip,Red);
      }
      if(ops-TR>Ask&&pris==0)
      {
      OrderModify(OrderTicket(),OrderOpenPrice(), ops-0.0001, OrderTakeProfit(), 0);
     
      }      
      if(pris-TR>Ask)                         
      {
      OrderModify(OrderTicket(),OrderOpenPrice(), Ask + TR, OrderTakeProfit(), 0);
      GetLastError();        
      }                  
     }
     
     }
     }
     }
Comment("=Òåéê Ïðîôèò==",TakeProfit," ï",
"\n","=Ñòîï Ëîññ====",StopLoss," ï",
"\n","=Òðåéëèíã Ñòîï=",Tral," ï");    
return(0);}

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---