Zmei_trader

Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself It can change open orders parameters, due to possible stepping strategy
Indicators Used
Bill Williams Awesome oscillator
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
0.00 %
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/CAD Oct 2024 - Jan 2025
0.00 %
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.00 %
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
Zmei_trader
extern double Lot = 0.1; // ðàçìåð ëîòà
extern int StartBar = 0; // íà÷àëüíûé áàð, ñ êîòîðîãî èäåò îòñ÷åò äâóõ îäèíàêîâûõ ïàëîê
extern int TakeProfit = 20;
extern int StopLoss = 10;
extern int Trailing = 10; // Âåëè÷èíà òðåéëèíãà
extern int MaxOrders = 1; // ìàêñèìàëüíîå êîëè÷åñòâî îäíîâðåìåíî îòêðûòûõ îðäåðîâ
datetime last;
int start()
  {
   double ao1,ao2,ao3;
if(OrdersTotal()>0) TrailingControl();
if((Time[0]-last)>=Period()*60)
{
   ao1=iAO(Symbol(),0,StartBar);
   ao2=iAO(Symbol(),0,StartBar+1);
   ao3=iAO(Symbol(),0,StartBar+2);
   if(ao1<ao2 && ao2<ao3) OrderOp(OP_SELL);
   if(ao2>ao3 && ao1>ao2) OrderOp(OP_BUY);
   last=Time[0];
}
   return(0);
  }
int OrderOp(int ord)
{
   double TP,SL,ticket;
if(OrdersTotal()<MaxOrders)
{
   if(ord==OP_BUY)
   {
      TP=Bid+TakeProfit*Point; if(TakeProfit==0) TP=0;
      SL=Ask-StopLoss*Point;   if(StopLoss==0) SL=0;
      ticket=OrderSend(Symbol(),OP_BUY,Lot,Ask,3,SL,TP,"Ïîêóïàåì",16384,0,White);
   }
   if(ord==OP_SELL)
   {
      TP=Ask-TakeProfit*Point; if(TakeProfit==0) TP=0;
      SL=Bid+StopLoss*Point;   if(StopLoss==0) SL=0;
      ticket=OrderSend(Symbol(),OP_SELL,Lot,Bid,3,SL,TP,"Ïðîäàåì",16384,0,Yellow);
   }
}
}

int OrderCl(int ord)
{
   int cnt;
   for(cnt=OrdersTotal();cnt>0;cnt--)
   {
      OrderSelect(cnt-1, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()==OP_BUY  && ord==OP_BUY)  OrderClose(OrderTicket(),OrderLots(),Bid,3,White);
      if(OrderType()==OP_SELL && ord==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,3,Yellow);
   }
}

int TrailingControl()
{
   int total=OrdersTotal(),cnt;
   
   for(cnt=0;cnt<total;cnt++)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()<=OP_SELL && OrderSymbol()==Symbol())
        {
         if(OrderType()==OP_BUY)
           {
            if(Trailing>0)  
              {                 
               if(Bid-OrderOpenPrice()>Point*Trailing)
                 {
                  if(OrderStopLoss()<Bid-Point*Trailing)
                    {
                     OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*Trailing,OrderTakeProfit(),0);
                     return(0);
                    }
                 }
              }
           }
         else
           {
            if(Trailing>0)  
              {                 
               if((OrderOpenPrice()-Ask)>(Point*Trailing))
                 {
                  if(OrderStopLoss()>(Ask+Point*Trailing))
                    {
                     OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*Trailing,OrderTakeProfit(),0);
                     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 ---