Sys_BuySell_to_Pashkendr____1

Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
82.00 %
Total Trades 130
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -0.91
Gross Profit 540.00
Gross Loss -658.00
Total Net Profit -118.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
85.00 %
Total Trades 141
Won Trades 40
Lost trades 101
Win Rate 0.28 %
Expected payoff -0.76
Gross Profit 600.00
Gross Loss -707.00
Total Net Profit -107.00
-100%
-50%
0%
50%
100%
Sys_BuySell_to_Pashkendr____1
extern double TakeProfit = 150;
extern double StopLoss = 70;
extern double Lots = 0.1;
//extern int HourTorg = 0;


int start()
  {
  
   int cnt, ticket, total;

   total=OrdersTotal();
   if(total<1) 
     {
      // no opened orders identified
      if((Hour()==11 || Hour()==17) && Minute()==0 && Close[1]>Close[3] && Close[1]-Close[3]>3*Point)
      //if(Hour()==HourTorg && Minute()==0 && Close[1]>Close[3] && Close[1]-Close[3]>3*Point)
      {
      // check for long position (BUY) possibility
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,2,Ask-StopLoss*Point,Ask+TakeProfit*Point,"Sys",16384,0,LawnGreen);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
           }
         else Print("Error opening BUY order : ",GetLastError()); 
      return(0);
      }

      if((Hour()==11 || Hour()==17) && Minute()==0 && Close[1]<Close[3] && Close[3]-Close[1]>3*Point)
      //if(Hour()==HourTorg && Minute()==0 && Close[1]<Close[3] && Close[3]-Close[1]>3*Point)
      {
      // check for short position (SELL) possibility
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,2,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Sys",16384,0,Red);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
           }
         else Print("Error opening SELL order : ",GetLastError()); 
      return(0);
      }
      return(0);
     }
   return(0);
  }
 //the end.


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 ---