Termos de Referência
//+------------------------------------------------------------------+
//| XAUUSD FULL AUTO SAFE BOT MT5 |
//| Converted from Pine Script v5 |
//+------------------------------------------------------------------+
#property copyright "Converted by ChatGPT"
#property version "1.00"
#property strict
#include <Trade/Trade.mqh>
CTrade trade;
// === INPUT ===
input double LotPercent = 1.0; // % Equity
input int EMAFast = 50;
input int EMASlow = 200;
input int RSILength = 14;
input int ATRLength = 14;
input double RiskReward = 2.0;
// === INDICATOR HANDLES ===
int emaFastHandle, emaSlowHandle, rsiHandle, atrHandle;
//+------------------------------------------------------------------+
int OnInit()
{
emaFastHandle = iMA(_Symbol, _Period, EMAFast, 0, MODE_EMA, PRICE_CLOSE);
emaSlowHandle = iMA(_Symbol, _Period, EMASlow, 0, MODE_EMA, PRICE_CLOSE);
rsiHandle = iRSI(_Symbol, _Period, RSILength, PRICE_CLOSE);
atrHandle = iATR(_Symbol, _Period, ATRLength);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
void OnTick()
{
static datetime lastBarTime = 0;
datetime currentBarTime = iTime(_Symbol, _Period, 0);
// === Execute only on new candle ===
if(currentBarTime == lastBarTime) return;
lastBarTime = currentBarTime;
if(PositionSelect(_Symbol)) return; // 1 posisi saja
double emaFast[2], emaSlow[2], rsi[2], atr[1];
CopyBuffer(emaFastHandle, 0, 0, 2, emaFast);
CopyBuffer(emaSlowHandle, 0, 0, 2, emaSlow);
CopyBuffer(rsiHandle, 0, 0, 2, rsi);
CopyBuffer(atrHandle, 0, 0, 1, atr);
double closePrice = iClose(_Symbol, _Period, 1);
bool bullTrend = emaFast[1] > emaSlow[1];
bool bearTrend = emaFast[1] < emaSlow[1];
bool buySignal =
bullTrend &&
closePrice > emaSlow[1] &&
rsi[1] > 45 && rsi[0] <= 45;
bool sellSignal =
bearTrend &&
closePrice < emaSlow[1] &&
rsi[1] < 55 && rsi[0] >= 55;
double lot = NormalizeDouble(AccountInfoDouble(ACCOUNT_EQUITY)
* LotPercent / 100 / 1000, 2);
if(buySignal)
{
double sl = closePrice - atr[0];
double tp = closePrice + atr[0] * RiskReward;
trade.Buy(lot, _Symbol, 0, sl, tp, "BUY XAU SAFE");
}
if(sellSignal)
{
double sl = closePrice + atr[0];
double tp = closePrice - atr[0] * RiskReward;
trade.Sell(lot, _Symbol, 0, sl, tp, "SELL XAU SAFE");
}
}
//+------------------------------------------------------------------+
Respondido
1
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
2
Classificação
Projetos
0
0%
Arbitragem
1
0%
/
100%
Expirado
0
Livre
3
Classificação
Projetos
186
41%
Arbitragem
24
58%
/
21%
Expirado
13
7%
Livre
4
Classificação
Projetos
8
0%
Arbitragem
0
Expirado
0
Livre
5
Classificação
Projetos
394
53%
Arbitragem
20
55%
/
15%
Expirado
28
7%
Carregado
6
Classificação
Projetos
38
24%
Arbitragem
14
0%
/
93%
Expirado
4
11%
Livre
7
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
8
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
9
Classificação
Projetos
253
30%
Arbitragem
0
Expirado
3
1%
Livre
Publicou: 2 códigos
Pedidos semelhantes
SpikeEnginePro EA
30+ USD
// Add this to your EA after ExportState() function void SendToBase44(const string state, const string dir, double entry, double sl, double tp) { string url = " https://preview-sandbox--ee0a32a725b788974de435e8cef40b7a.base44.app/api/functions/receiveEAState "; string headers = "Content-Type: application/json\r\n"; string json = "{" "\"symbol\":\""+_Symbol+"\","
1.Sinyal Perdagangan : Sinyal beli: garis MACD utama memotong garis sinyal ke atas (macd_current>signal_current && macd_previous<signal_previous). Sinyal jual: garis MACD utama memotong garis sinyal ke bawah (macd_current<signal_current && macd_previous>signal_previous). Gambar di bawah menunjukkan kasus beli dan jual. 2. Posisi ditutup pada sinyal yang berlawanan: Posisi beli ditutup pada sinyal jual, dan posisi
EA grid hunter
30 - 200 USD
1. Platform & Environment Platform: MetaTrader 5 (MT5 ONLY) Language: MQL5 Account type: ECN / Netting or Hedging Designed for broker rebate/commission return programs No DLLs, no external dependencies 2. Strategy Overview The EA is a high-frequency scalping Expert Advisor focused on maximizing the number of trades with minimal price movement, where the main source of profitability is broker rebate rather than market
Informações sobre o projeto
Orçamento
100+ USD
Cliente
Pedidos postados1
Número de arbitragens0