Author: Copyright � 2009, MetaQuotes Software Corp.
Price Data Components
Series array that contains open time of each bar
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedChecks for the total of closed orders
Indicators Used
MACD Histogram
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
17.00 %
Total Trades 6
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -41.67
Gross Profit 50.00
Gross Loss -300.00
Total Net Profit -250.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
18.00 %
Total Trades 13
Won Trades 11
Lost trades 2
Win Rate 0.85 %
Expected payoff -37.69
Gross Profit 110.00
Gross Loss -600.00
Total Net Profit -490.00
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
11.00 %
Total Trades 7
Won Trades 5
Lost trades 2
Win Rate 0.71 %
Expected payoff -60.79
Gross Profit 50.00
Gross Loss -475.50
Total Net Profit -425.50
-100%
-50%
0%
50%
100%
Forex SKY
//+------------------------------------------------------------------+
//|                                                    Forex Sky.mq4 |
//|                          Copyright © 2009, Sivakumar Paulsuyambu |
//|                                 http://softinfolife.blogspot.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

datetime Time0 = 0;

extern int TakeProfit = 100;
extern int StopLoss = 3000;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
           
          if(
             (iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>0 && iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>0.00009
             && (iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)<=0 || iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,2)<=0
                 || iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,3)<=0
                  )                  
                  )                 
            )
          { 
           if(OrdersTotal()==0)
           {
              if (Time0 != Time[0] && CheckTodaysOrders()==0)
               {

                OrderSend(Symbol(),OP_BUY,0.1,Ask,2,Ask-StopLoss*Point,Ask+TakeProfit*Point,"My order #2",16384,0,Green);
                Time0 = Time[0];
              
                } 
           }
          } 
           else if(
             (iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)<0 && iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)<-0.0004
              && (iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1)>=0 || iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,2)>=0
                 || iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,3)>=0
                  )
              &&    iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,4)>=0.001  )
              || iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,4)>=0.003 
            )
          { 
           if(OrdersTotal()==0)
           {
              if (Time0 != Time[0] && CheckTodaysOrders()==0)
               {

               OrderSend(Symbol(),OP_SELL,0.1,Bid,2,Bid+StopLoss*Point,Bid-TakeProfit*Point,"My order #2",16384,0,Green);
               
                Time0 = Time[0];
              
                } 
           }
          } 
          

//----
   return(0);
  }
//+------------------------------------------------------------------+


int CheckTodaysOrders(){

int TodaysOrders = 0;

for(int i = OrdersTotal()-1; i >=0; i--){

OrderSelect(i, SELECT_BY_POS,MODE_TRADES);

if(TimeDayOfYear(OrderOpenTime()) == TimeDayOfYear(TimeCurrent())){

TodaysOrders += 1;

}

}

for(i = OrdersHistoryTotal()-1; i >=0; i--){

OrderSelect(i, SELECT_BY_POS,MODE_HISTORY);

if(TimeDayOfYear(OrderOpenTime()) == TimeDayOfYear(TimeCurrent())){

TodaysOrders += 1;

}

}

return(TodaysOrders);

}

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