Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It can change open orders parameters, due to possible stepping strategyIt automatically opens orders when conditions are reached
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
9.00 %
Total Trades 780
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -4.22
Gross Profit 316.00
Gross Loss -3604.40
Total Net Profit -3288.40
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.00 %
Total Trades 246
Won Trades 0
Lost trades 246
Win Rate 0.00 %
Expected payoff -3.21
Gross Profit 0.00
Gross Loss -788.70
Total Net Profit -788.70
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.00 %
Total Trades 490
Won Trades 0
Lost trades 490
Win Rate 0.00 %
Expected payoff -2.92
Gross Profit 0.00
Gross Loss -1428.60
Total Net Profit -1428.60
-100%
-50%
0%
50%
100%
JK_sinkhro
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                   JK_sinkhro.mq4 |
//|                                                              JK. |
//|                                                                  |
//+------------------------------------------------------------------+

extern double TakeProfit = 100; // ÍÅ ÈÑÏÎËÜÇÓÅÒÑß
extern double TakeProfit2 = 36; // ÏÐÈ ÄÎÑÒÈÆÅÍÈß ÝÒÎÃÎ ÏÐÎÔÈÒÀ ÇÀÊÐÛÂÀÅÒ ÏÎÇÓ
extern double Stoploss = 82; //ÁÅÇ ÊÎÌÅÍÒÀÐÈÅÂ
extern double Lots = 0.1; //ÒÓÒ ÒÎÆÅ ÂÑÅ ÄÎËÆÍÎ ÁÛÒÜ ÏÎÍßÒÍÎ
extern double TrailingStop = 30; //ÎÏÒÈÌÀËÜÍÎE ÇÍÀ×ÅÍÈÅ ÌÎÆÅÒÅ ÏÎÄÁÈÐÀÒÜ, ÍÎ ÌÍÅ ÁÎËÜØÅ ÏÎÍÐÀÂÈËÎÑÜ ÁÅÇ ÒÐÀËÀ
extern double per=18;  //ÊÎËËÈ×ÅÑÒÂÎ ÀÍÀËÈÇÈÐÓÅÌÛÕ ÑÂÅ×ÅÊ
extern double per2=8; //ÍÅ ÈÑÏÎËÜÇÓÅÒÑß
extern double chas=2; //Ñìåùåíèå âðåìåíè
extern double totalt=1000; //ÎÄÍÎÂÐÅÌÅÍÍÎ ÎÒÊÐÛÒÛÕ ÏÎÇ ÌÎÆÅÒ  ÁÛÒÜ ÍÅ ÁÎËÅÅ ×ÅÌ 
extern double mm=0; // ìì
extern double risk=10; //ðÈÑÊ Î ÌÌ
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {

int cnt, ticket, total;
if(Bars<100)
   {
      Print("bars less than 100");
      return(0);  
   }
if(TakeProfit<0)
   {
      Print("TakeProfit less than 10");
      return(0);  // check TakeProfit
   }

double Lotsi;  
if (mm!=0)  
   {         
      Lotsi=NormalizeDouble(AccountFreeMargin()*risk/100001,1);   
      if (Lotsi<0.1)  Lotsi=0.1;   
   }  
else Lotsi=Lots; 

//if ((CurTime()-OrderOpenTime())<61) return(0);
int up, down; up=0; down=0;
for(cnt=1;cnt<per;cnt++)
if (Open[cnt]>Close[cnt]) up=up+1;
for(cnt=1;cnt<per;cnt++)
if (Open[cnt]<Close[cnt]) down=down+1;


		
							
int j;
j=0;



  
total=OrdersTotal();

   
for(cnt=0;cnt<total;cnt++)
   {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()<=OP_SELL && OrderSymbol()==Symbol())  // check for symbol
         {j=1;
            if(OrderType()==OP_BUY)
               {
                  if(Bid-OrderOpenPrice()>=TakeProfit2*Point)
                     {
                        OrderClose(OrderTicket(),OrderLots(),Bid,0,Violet); return(0);
                     }
            
                  if(TrailingStop>0)  
                     {                 
                        if(Bid-OrderOpenPrice()>Point*TrailingStop)
                           {
                              if(OrderStopLoss()<Bid-Point*TrailingStop)
                                 {
                                    OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green); return(0);
                                 }
                           }
                     }
               }
            else
               {
                  if(OrderOpenPrice()-Ask>=TakeProfit2*Point)
                     {
                        OrderClose(OrderTicket(),OrderLots(),Ask,0,Violet); return(0);
                     }
                  if(TrailingStop>0)  
                     {                 
                        if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                           {
                              if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
                                 {
                                    OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red); return(0);
                                 }
                           }
                     }
               }
         }  
   }



if (total<totalt)
    {  if(up>down && (22+(chas)==Hour()|| 19+(chas)==Hour()) &&Minute()<5)// && j==1)
         {
            OrderSend(Symbol(),OP_BUY,Lotsi,Ask,0,Bid-Stoploss*Point,Ask+TakeProfit*Point,"jk_prof",16384,0,Green); return(0); 
         }
      if(up<down && (22+(chas)==Hour()|| 19+(chas)==Hour()) && Minute()<5)// && j==1)
         {
            OrderSend(Symbol(),OP_SELL,Lotsi,Bid,3,Ask+Stoploss*Point,Bid-TakeProfit*Point,"macd sample",16384,0,Red); 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 ---