125LimitIBFX

Orders Execution
It automatically opens orders when conditions are reachedChecks for the total of open orders
0 Views
0 Downloads
0 Favorites

Profitability Reports

GBP/USD Oct 2024 - Jan 2025
38.00 %
Total Trades 459
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -18.43
Gross Profit 5260.00
Gross Loss -13720.00
Total Net Profit -8460.00
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
18.00 %
Total Trades 280
Won Trades 108
Lost trades 172
Win Rate 0.39 %
Expected payoff -35.16
Gross Profit 2160.00
Gross Loss -12005.00
Total Net Profit -9845.00
-100%
-50%
0%
50%
100%
125LimitIBFX

extern double  Lot=1;

extern int jarak=15,target=20,stop=70;
extern int JamMulaiTrading=17,JamSelesaiLimit=23;

int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
        EntryLimit(JamMulaiTrading,JamSelesaiLimit,jarak,target,stop);
//----
   return(0);
  }
//+------------------------------------------------------------------+


void EntryLimit(int jam,int selesai,int delta,int TP,int SL)
{   
   if (TimeHour(TimeCurrent())==selesai && ( ChkJmlTrd(2)>0 || ChkJmlTrd(3)>0)) DeleteSemuaLimitOrder();
   if (TimeHour(TimeCurrent())<selesai && TimeHour(TimeCurrent())>=jam && ChkJmlTrd(2)==0 && ChkJmlTrd(0)==0)
      OrderSend(Symbol(),OP_BUYLIMIT,Lot,Bid-delta*Point,0,Bid-(delta+SL)*Point,Bid+(TP-delta)*Point,"LB",0,0,Blue);
      
    if (TimeHour(TimeCurrent())<selesai && TimeHour(TimeCurrent())>=jam && ChkJmlTrd(3)==0 && ChkJmlTrd(1)==0) 
      OrderSend(Symbol(),OP_SELLLIMIT,Lot,Bid+delta*Point,0,Bid+(SL+delta)*Point,Bid+(delta-TP)*Point,"LS",0, 0,Red);
}

int ChkJmlTrd(int mode)//, int MagicEA)
{
   //Constant        Value Description 
   //--------        ----- ----------------------------
   //OP_BUY          0     Buying position. 
   //OP_SELL         1     Selling position. 
   //OP_BUYLIMIT     2     Buy limit pending position. 
   //OP_SELLLIMIT    3     Sell limit pending position. 
   //OP_BUYSTOP      4     Buy stop pending position. 
   //OP_SELLSTOP     5     Sell stop pending position. 

   //--------        ----- ----------------------------
   int i, JmlTrd;
   for (i=0; i<OrdersTotal(); i++)
   {
      OrderSelect(i,SELECT_BY_POS, MODE_TRADES);
      if(OrderType()==mode && OrderSymbol()==Symbol())// && OrderMagicNumber()==MagicEA)
      {
         JmlTrd++;
      }
   }
   return(JmlTrd);
}

void DeleteSemuaLimitOrder()
{
   int i;
   for(i = OrdersTotal(); i >= 0; i--)
   {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if((OrderType()==OP_BUYLIMIT || OrderType()==OP_SELLLIMIT) && OrderSymbol()==Symbol())  
      {
         OrderDelete(OrderTicket()); 
      }
   }
}



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