martingeil-2direct+breack-and-down-Laut

Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
32.00 %
Total Trades 12
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -665.96
Gross Profit 3688.00
Gross Loss -11679.50
Total Net Profit -7991.50
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
35.00 %
Total Trades 16
Won Trades 8
Lost trades 8
Win Rate 0.50 %
Expected payoff -355.72
Gross Profit 3080.00
Gross Loss -8771.50
Total Net Profit -5691.50
-100%
-50%
0%
50%
100%
martingeil-2direct+breack-and-down-Laut
//+------------------------------------------------------------------+
//|                                     martingeil-2direct-Laut real |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
 double startLots = 0.5;
// Ëîò-ïðîãðåññèÿ 1-2 -3 -4  -5 -8
// Øàã-ïðîãðåññèÿ 0-20-40-80-160-320 
 double Step=50;
 double StepFactor=2;



int k;
int ticket;
int Ordertype;
double priceClose;
double priceCloseB;
double priceCloseS;
double b1,b2,b3,b4,b5,b6,s1,s2,s3,s4,s5,s6;



int start()
 {

double Lots1 = startLots;
double Lots2 = startLots*2;
double Lots3 = startLots*3;
double Lots4 = startLots*4;
double Lots5 = startLots*5;
double Lots6 = startLots*8;




  k=OrdersTotal();


if (k==0)
   {
s1=Ask+Step*Point;
s2=s1+Step*StepFactor*Point;
s3=s2+Step*MathPow(StepFactor,2)*Point;
s4=s3+Step*MathPow(StepFactor,3)*Point;
s5=s4+Step*MathPow(StepFactor,4)*Point;



b1=Bid-Step*Point;
b2=b1-Step*StepFactor*Point;
b3=b1-Step*MathPow(StepFactor,2)*Point;
b4=b2-Step*MathPow(StepFactor,3)*Point;
b5=b4-Step*MathPow(StepFactor,4)*Point;



//Íà÷àëüíûå îðäåðû
OrderSend(Symbol(),OP_BUY,Lots1,Ask,3,NULL,NULL,NULL,100,0,Blue);
OrderSend(Symbol(),OP_SELL,Lots1,Bid,3,NULL,NULL,NULL,200,0,Green);

OrderSend(Symbol(),OP_BUYLIMIT,Lots2,b1,3,NULL,Ask,NULL,101,0,Red);
OrderSend(Symbol(),OP_SELLLIMIT,Lots2,s1,3,NULL,Bid,NULL,201,0,Yellow);
OrderSend(Symbol(),OP_SELLSTOP,Lots1,b1,3,NULL,NULL,NULL,301,0,Green);
OrderSend(Symbol(),OP_BUYSTOP,Lots1,s1,3,NULL,NULL,NULL,401,0,Green);

OrderSend(Symbol(),OP_BUYLIMIT,Lots3,b2,3,NULL,b1,NULL,102,0,Red);
OrderSend(Symbol(),OP_SELLLIMIT,Lots3,s2,3,NULL,s1,NULL,202,0,Yellow);
OrderSend(Symbol(),OP_SELLSTOP,Lots1,b2,3,NULL,NULL,NULL,302,0,Green);
OrderSend(Symbol(),OP_BUYSTOP,Lots1,s2,3,NULL,NULL,NULL,402,0,Green);


OrderSend(Symbol(),OP_BUYLIMIT,Lots4,b3,3,NULL,b2,NULL,103,0,Red);
OrderSend(Symbol(),OP_SELLLIMIT,Lots4,s3,3,NULL,s2,NULL,203,0,Yellow);
OrderSend(Symbol(),OP_SELLSTOP,Lots1,b3,3,NULL,NULL,NULL,303,0,Green);
OrderSend(Symbol(),OP_BUYSTOP,Lots1,s3,3,NULL,NULL,NULL,403,0,Green);


OrderSend(Symbol(),OP_BUYLIMIT,Lots5,b4,3,NULL,b3,NULL,104,0,Red);
OrderSend(Symbol(),OP_SELLLIMIT,Lots5,s4,3,NULL,s3,NULL,204,0,Yellow);
OrderSend(Symbol(),OP_SELLSTOP,Lots1,b4,3,NULL,NULL,NULL,304,0,Green);
OrderSend(Symbol(),OP_BUYSTOP,Lots1,s4,3,NULL,NULL,NULL,404,0,Green);


OrderSend(Symbol(),OP_BUYLIMIT,Lots6,b5,3,NULL,b4,NULL,105,0,Red);
OrderSend(Symbol(),OP_SELLLIMIT,Lots6,s5,3,NULL,s4,NULL,205,0,Yellow);
OrderSend(Symbol(),OP_SELLSTOP,Lots1,b5,3,NULL,NULL,NULL,305,0,Green);
OrderSend(Symbol(),OP_BUYSTOP,Lots1,s5,3,NULL,NULL,NULL,405,0,Green);
   }


k=OrdersTotal();





if (k<=21)
{

   for(int m=0;m<=k-1;m++)
   {
      if(OrderSelect(m,SELECT_BY_POS) && OrderSymbol()==Symbol())
      {
      Ordertype=OrderType();
      ticket=OrderTicket();
      switch(Ordertype)
         {
         case 0:
         priceClose=MarketInfo(OrderSymbol(),MODE_BID);
         OrderClose(ticket,OrderLots(),priceClose,3,Red);
         break;

         case 1:
         priceClose=MarketInfo(OrderSymbol(),MODE_ASK);
         OrderClose(ticket,OrderLots(),priceClose,3,Red);
         break;

         default:
            OrderDelete(ticket);
            break;
         }
       }
   }      
}     
  
}


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