InterestPay v1.2

Author: Copyright � 2006, Ross Todd
Profit factor:
0.30
Price Data Components
Series array that contains open time of each bar
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reached
1 Views
0 Downloads
0 Favorites
InterestPay v1.2
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                            InterestPay v1.2.mq4 |
//|                                      Copyright © 2006,  Ross Tod |
//|                                               rosstodd@yahoo.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006,  Ross Todd"
#property link      "rosstodd@yahoo.com"
extern double Lots       = 1;
extern int CloseShortHr  = 20;
extern int CloseShortMin = 58;
extern int CloseLongHr   = 21;
extern int CloseLongMin  = 2;
extern int OpenHr        = 20;
extern int OpenMin       = 30;
extern int MagicNumber   = 20061002;

bool ShortSent=False;
bool LongSent=False;
bool ContinueOpening=False;
int Slippage = 5;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   int cnt=0;
   int OpenOrders=0;
   bool res=False;
   
   for(cnt=0;cnt<OrdersTotal();cnt++)
   {
     if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES))
     {
      if ((OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber))
      {
       OpenOrders++;
      }
     }
   }
   
   if (TimeHour(CurTime())==CloseShortHr
       && TimeMinute(CurTime())>=CloseShortMin)
   {
    for(cnt=0;cnt<OrdersTotal();cnt++)
    {
     if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES))
     {
      if (OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && OrderType()==OP_SELL)
       res=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,Red);
     }
    }
   }
   
   if (TimeHour(CurTime())==CloseLongHr
       && TimeMinute(CurTime())>=CloseLongMin)
   {
    for(cnt=0;cnt<OrdersTotal();cnt++)
    {
     if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES))
     {
      if (OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && OrderType()==OP_BUY)
       res=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,Blue);
     }
    }
   }
   
   if (TimeHour(CurTime())==OpenHr
       && TimeMinute(CurTime())==OpenMin && OpenOrders<1)
   {
    ContinueOpening=True;
    LongSent=False;
    ShortSent=False;
   }

   if (!ShortSent && ContinueOpening)
   {
    res=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,"InterestPay"+MagicNumber,MagicNumber,0,Red);
    if (res)
     ShortSent=True;     
    else
     Print("Short Send Order error: ", GetLastError());
   }    

   if (!LongSent && ContinueOpening)
   {
    res=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"SeparationTrade"+MagicNumber,MagicNumber,0,Blue);
    if (res)
     LongSent=True;
    else
     Print("Long Send Order error: ", GetLastError());
   }  
      
   
   if (ShortSent && LongSent)
    ContinueOpening=False;
//----
   return(0);
  }
//+------------------------------------------------------------------+


Profitability Reports

NZD/USD Oct 2024 - Jan 2025
0.29
Total Trades 134
Won Trades 43
Lost trades 91
Win Rate 32.09 %
Expected payoff -18.78
Gross Profit 1041.00
Gross Loss -3557.00
Total Net Profit -2516.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.25
Total Trades 134
Won Trades 41
Lost trades 93
Win Rate 30.60 %
Expected payoff -39.01
Gross Profit 1779.00
Gross Loss -7007.00
Total Net Profit -5228.00
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.37
Total Trades 134
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -15.55
Gross Profit 1238.00
Gross Loss -3322.00
Total Net Profit -2084.00
-100%
-50%
0%
50%
100%

Comments