Orders Execution
Checks for the total of open ordersIt can change open orders parameters, due to possible stepping strategyIt automatically opens orders when conditions are reached
Indicators Used
Moving average indicator
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
72.00 %
Total Trades 345
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -2.20
Gross Profit 1929.40
Gross Loss -2689.60
Total Net Profit -760.20
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
67.00 %
Total Trades 387
Won Trades 198
Lost trades 189
Win Rate 0.51 %
Expected payoff -4.09
Gross Profit 3205.80
Gross Loss -4789.30
Total Net Profit -1583.50
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
62.00 %
Total Trades 346
Won Trades 168
Lost trades 178
Win Rate 0.49 %
Expected payoff -2.84
Gross Profit 1634.40
Gross Loss -2618.30
Total Net Profit -983.90
-100%
-50%
0%
50%
100%
HL_MA_v04
//+------------------------------------------------------------------+ 
//|                                                     High&Low.mq4 | 
//|                                  Copyright © 2007, Shadow Trader | 
//|                                   e-mail: ShadowTrader@fxmail.ru | 
//+------------------------------------------------------------------+ 
// Ýêñïåðò ïðåäíàçíà÷åí äëÿ ðàáîòû íà äíåâêàõ.
// Ïàðàìåòðû óñòàíîâëåíû äëÿ ïàðû EURUSD
extern int ma_period = 20;
extern double SL_percent_of_channel = 2.1;
double lots   = 0.1;
double sl;
double tp;


int init ()
{ 
   return(0);
} 

int deinit()
{
   return(0);
}

int day=1;

int start()
{
   if (AccountFreeMargin() < 120)
      return (0);

   double mah = iMA(Symbol(), 0, ma_period, 0, MODE_LWMA, PRICE_HIGH, 1);
   double mal = iMA(Symbol(), 0, ma_period, 0, MODE_LWMA, PRICE_LOW,  1);
      
   if (OrdersTotal() > 0)
   {
      if (Volume[0]>day)
         return (0);
      else
      {
         for (int i = 0; i < OrdersTotal(); i++)
         {
            if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == TRUE)
            {
               if (OrderType() == OP_BUY)
               {
                  if (OrderStopLoss() < mal)
                      OrderModify(OrderTicket(), Ask, mal, OrderTakeProfit(), 0, Gold);
               }

               if (OrderType() == OP_SELL)
               {
                  if (OrderStopLoss() > mah)
                      OrderModify(OrderTicket(), Bid, mah, OrderTakeProfit(), 0, Green);
               }
            }
         }
         return (0);
      }
   }

   // Ïîêóïêà
   if ( Close[1] > mah && Low [0] > mah )
   {
      sl = Ask-SL_percent_of_channel*(mah-mal);
      tp = Ask + (mah - mal);
      OrderSend(Symbol(), OP_BUY, lots, Ask, 3, sl, tp, "", 0, 0, Blue);
   }

   // Ïðîäàæà
   if ( Close[1] < mal && High[0] < mal )
   {
      sl = Bid+SL_percent_of_channel*(mah-mal);
      tp = Bid - (mah - mal);
      OrderSend(Symbol(), OP_SELL, lots, Bid, 3, sl, tp, "", 0, 0, Red);
   }

   return(0);
}

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