Orders Execution
Indicators Used
0
Views
0
Downloads
0
Favorites
Profitability Reports
AUD/USD
Oct 2024 - Jan 2025
23.00 %
Total Trades
660
Won Trades
0
Lost trades
0
Win Rate
0.00 %
Expected payoff
-14.89
Gross Profit
2960.00
Gross Loss
-12788.00
Total Net Profit
-9828.00
-100%
-50%
0%
50%
100%
GBP/USD
Oct 2024 - Jan 2025
0.00 %
Total Trades
0
Won Trades
0
Lost trades
0
Win Rate
0.0 %
Expected payoff
0.00
Gross Profit
0.00
Gross Loss
0.00
Total Net Profit
0.00
-100%
-50%
0%
50%
100%
NZD/USD
Oct 2024 - Jan 2025
11.00 %
Total Trades
498
Won Trades
58
Lost trades
440
Win Rate
0.12 %
Expected payoff
-19.74
Gross Profit
1160.00
Gross Loss
-10993.00
Total Net Profit
-9833.00
-100%
-50%
0%
50%
100%
HolyGrailExpertM5
//+------------------------------------------------------------------+
//| HolyGrailExpertM5.0.mq4 |
//| Copyright © 2006, systrad5 |
//| 17/09/06 |
//| Feedback or comments welcome at xeylee@yahoo.com |
//+------------------------------------------------------------------+
//
#define MAGICGRAIL 20050917
//---- input parameters
extern double TakeProfit = 20.0;
extern double StopLoss = 25.0;
extern double Lots = 1;
extern int HLPeriod = 3;
extern int MAPeriod = 7;
extern int MASlope = 1;
extern int TgtThreshold = 3;
//---- Globals & Buffers
double Threshold, HEntry = 0, LEntry = 0, PrevHigh, PrevLow, Spread;
double MA1,MA2;
int MADir;
datetime prevtime = 0; //Used to determine opening bar
//+------------------------------------------------------------------+
//| Start function |
//+------------------------------------------------------------------+
void start()
{
int Dir;
Threshold = TgtThreshold * Point;
//---- Calc Buffers
if(prevtime == Time[0])
{
// IntraBar Tick
// Determine if H[0] or L[0] over previous
if(Low[0] < PrevLow)
{
LEntry = Low[0] + Threshold + (TakeProfit * Point);
Spread = PrevHigh - Low[0];
if (Spread < (2 * Threshold) + (TakeProfit * Point)) LEntry = 0;
}
//----
if(High[0] > PrevHigh)
{
HEntry = High[0] - Threshold - (TakeProfit * Point);
Spread = High[0] - PrevLow;
if(Spread < (2 * Threshold) + (TakeProfit * Point))
HEntry = 0;
}
// Check to see if price has broken entry barrier
Dir = 0;
//----
if(Ask < HEntry && HEntry != 0 && MADir ==1)
Dir = 1;
//----
if(Bid > LEntry && LEntry != 0 && MADir ==-1)
Dir = -1;
}
else
{
// Calc MA
MA1 = iMA(NULL, 0, MAPeriod, 0, MODE_EMA, PRICE_TYPICAL, 1);
MA2 = iMA(NULL, 0, MAPeriod, 0, MODE_EMA, PRICE_TYPICAL, 2);
if(MA1 > MA2 + (MASlope*Point))
MADir = 1;
else
{
if (MA1 < MA2 - (MASlope*Point))
MADir = -1;
else
MADir = 0;
}
// Find High & Low of previous x Bars
PrevHigh = High[Highest(NULL, 0, MODE_HIGH, HLPeriod, 1)];
PrevLow = Low[Lowest(NULL, 0, MODE_LOW, HLPeriod, 1)];
if(HEntry + Threshold + (TakeProfit * Point) > PrevHigh)
HEntry = 0;
if(LEntry - Threshold - (TakeProfit * Point) < PrevLow)
LEntry = 0;
}
//---- calculate open orders by current symbol
if(CalculateCurrentOrders(Symbol()) == 0)
CheckForOpen(Dir);
else
{
HEntry = 0;
LEntry = 0;
}
//----- reset time
prevtime = Time[0];
//----
}
//+------------------------------------------------------------------+
//| Calculate open positions |
//+------------------------------------------------------------------+
int CalculateCurrentOrders(string symbol)
{
int buys = 0, sells = 0;
//----
for(int i = 0; i < OrdersTotal(); i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false)
break;
if(OrderSymbol() == Symbol() && OrderMagicNumber() == MAGICGRAIL)
{
if(OrderType() == OP_BUY)
buys++;
if(OrderType() == OP_SELL)
sells++;
}
}
//---- return orders volume
if(buys > 0)
return(buys);
else
return(-sells);
}
//+------------------------------------------------------------------+
//| Check for open order conditions |
//+------------------------------------------------------------------+
void CheckForOpen(int Dir)
{
int ticket;
//---- sell conditions
if(Dir == -1)
{
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 0, Bid + StopLoss*Point,
Bid - TakeProfit*Point, "Grail 1.0: Sell", MAGICGRAIL, 0, Red);
if(ticket < 1)
Print("Error opening SELL order : ", GetLastError());
return;
}
//---- buy conditions
if(Dir == 1)
{
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 0, Ask - StopLoss*Point,
Ask + TakeProfit*Point, "Grail 1.0: Buy", MAGICGRAIL, 0, Blue);
if(ticket<1) Print("Error opening BUY order : ", GetLastError());
return;
}
//----
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---