Orders Execution
Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
Profitability Reports
AUD/USD
Oct 2024 - Jan 2025
15.00 %
Total Trades
4679
Won Trades
0
Lost trades
0
Win Rate
0.00 %
Expected payoff
-1.39
Gross Profit
1123.80
Gross Loss
-7641.90
Total Net Profit
-6518.10
-100%
-50%
0%
50%
100%
GBP/USD
Oct 2024 - Jan 2025
1.00 %
Total Trades
392
Won Trades
4
Lost trades
388
Win Rate
0.01 %
Expected payoff
-1.85
Gross Profit
6.00
Gross Loss
-732.20
Total Net Profit
-726.20
-100%
-50%
0%
50%
100%
RSI Cross EA[1]
//+------------------------------------------------------------------+
//| RSI Cross EA.mq4 |
//| Copyright © 2007, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
//---- Include
#include <stderror.mqh>
#include <stdlib.mqh>
//---- Extern Variables
extern int RSI_Period = 12;
extern int RSISell = 80;
extern int RSIBuy = 20;
extern int applied_price = PRICE_CLOSE;
//---- Variables
double RSICurrent,RSIPrevious;
int counted_bars, nShift, limit, i;
//---- Prise de position
extern int TakeProfit = 15;
extern int StopLoss = 20;
int MagicNumber = 230307;
string NameEA = "RSI Cross EA";
double myPrice, myStopLoss, myTakeProfit, myLots, PriceNextMove;
int ticket, cnt, total, digits;
int Slippage =0;
//---- Optimisation des Lots
extern double Lots = 0.1;
//--- Debugage
extern bool Debug;
int OrderErr;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- Expert Advisor
digits = MarketInfo(Symbol(),MODE_DIGITS);
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
// counted_bars=IndicatorCounted();
//----
// if(counted_bars<0)
// return(-1);
// if(counted_bars>0)
// counted_bars--;
// limit=Bars;
// for(i=0; i<limit; i++)
// {
RSICurrent = iRSI(NULL,0,RSI_Period,applied_price,0);
RSIPrevious = iRSI(NULL,0,RSI_Period,applied_price,1);
//---- ALARM! ALARM!
//--- Buy Alarm
if(
(RSICurrent >= RSIBuy
&& RSIPrevious < RSIBuy)
)
{
//ExtMapBuffer1[i] = Low[i] -nShift*Point;
Alert("RSI Cross EA Going for a BUY Trend Sesion ",RSICurrent," Price ",Close[1]," for ", Symbol(),"-",Period());
PlaySound("alert.wav");
// myLots = LotsOptimized();
myLots = Lots;
myPrice = MarketInfo(Symbol(), MODE_ASK);
myStopLoss = 0;
if ( StopLoss > 0 )
myStopLoss = myPrice - StopLoss * Point ;
myTakeProfit = 0;
if ( TakeProfit > 0 )
myTakeProfit = myPrice + TakeProfit * Point;
// Normalize all price / stoploss / takeprofit to the proper # of digits.
if (digits > 0)
{
myPrice = NormalizeDouble( myPrice, digits);
myStopLoss = NormalizeDouble( myStopLoss, digits);
myTakeProfit = NormalizeDouble( myTakeProfit, digits);
}
ticket=OrderSend( Symbol(), OP_BUY, myLots, myPrice, Slippage, myStopLoss, myTakeProfit, "FirstBuy", MagicNumber, 0, Green);
if (ticket > 0)
{
if (OrderSelect( ticket,SELECT_BY_TICKET, MODE_TRADES) )
{
if (Debug)
Print("BUY order opened : ", OrderOpenPrice());
}
else
{
OrderErr = GetLastError();
Print("Error opening BUY order : (" + OrderErr + ") " + ErrorDescription( OrderErr) );
}
}
}
//--- Sell Alarm
if (
(RSICurrent <= RSISell
&& RSIPrevious > RSISell)
)
{
//ExtMapBuffer2[i] = High[i] + nShift*Point;
Alert("RSI Cross EA Going for a SELL Trend Sesion ",RSICurrent," Price ",Close[1]," for ", Symbol(),"-",Period());
PlaySound("alert.wav");
myLots = Lots;
myPrice = MarketInfo(Symbol(), MODE_BID);
myStopLoss = 0;
if ( StopLoss > 0 )
myStopLoss = myPrice + StopLoss * Point ;
myTakeProfit = 0;
if ( TakeProfit > 0 )
myTakeProfit = myPrice - TakeProfit * Point;
// Normalize all price / stoploss / takeprofit to the proper # of digits.
if (digits > 0)
{
myPrice = NormalizeDouble( myPrice, digits);
myStopLoss = NormalizeDouble( myStopLoss, digits);
myTakeProfit = NormalizeDouble( myTakeProfit, digits);
}
ticket=OrderSend( Symbol(), OP_SELL, myLots, myPrice, Slippage, myStopLoss, myTakeProfit, "First Sell", MagicNumber, 0, Red);
if (ticket > 0)
{
if (OrderSelect( ticket,SELECT_BY_TICKET, MODE_TRADES) )
{
if (Debug)
Print("SELL order opened : ", OrderOpenPrice());
}
else
{
OrderErr = GetLastError();
Print("Error opening SELL order : (" + OrderErr + ") " + ErrorDescription( OrderErr) );
}
}
}
// }
//----
return(0);
}
//+------------------------------------------------------------------+
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
---