Specification
//+------------------------------------------------------------------+
//| Sistema_Cartão_Branca_EA.mq5 |
//| ROBÔ AUTOMÁTICO — VERSÃO MT5 |
//+------------------------------------------------------------------+
#property copyright "Sistema Cartão Branca - MT5"
#propriedade versão "1.00"
#propriedade estrita
// --- BIBLIOTECAS OBRIGATÓRIAS PARA NEGOCIAÇÃO NO MT5 ---
#include <Trade\Trade.mqh>
#include <Trade\PositionInfo.mqh>
#include <Trade\SymbolInfo.mqh>
Negociação CTrade;
Informações sobre a posição CPositionInfo;
CSymbolInfo informações_do_símbolo;
// --- CONFIGURAÇÕES ---
input double Lote_Fixo = 0.01;
entrada dupla Risco_Por_Operacao = 1,0;
input bool Usar_Lote_Auto = true;
input int Stop_Loss_Pips = 25;
input int Take_Profit_Pips = 50;
insira o valor Magic_Number = 77777;
entrada uint Slippage = 30;
input bool Permitir_Compra = true;
input bool Permitir_Venda = true;
input bool Fechar_Sinal_Oposto = true;
entrada int EMA_Curta = 20;
entrada int EMA_Media = 50;
input int EMA_Longa = 200;
input int RSI_Periodo = 14;
entrada int MACD_Fast = 12;
entrada int MACD_Slow = 26;
entrada int MACD_Sinal = 9;
input int RSI_Sobrevenda = 30;
input int RSI_Sobrecompra = 70;
// --- ALÇAS ---
int h_ema20, h_ema50, h_ema200, h_rsi, h_macd;
ponto duplo; dígitos inteiros;
//+------------------------------------------------------------------+
//| INICIALIZAÇÃO |
//+------------------------------------------------------------------+
int OnInit()
{
trade.SetExpertMagicNumber(Magic_Number);
trade.SetSlippageInPoints(Slippage);
symbol_info.Select(_Symbol);
digitos=symbol_info.Digits();
ponto=symbol_info.Point();
if(dígitos==3 || dígitos==5) ponto*=10;
// Cria lida com
h_ema20 =iMA(_Symbol,_Period,EMA_Curta,0,MODE_EMA,PRICE_CLOSE);
h_ema50 =iMA(_Symbol,_Period,EMA_Media,0,MODE_EMA,PRICE_CLOSE);
h_ema200=iMA(_Symbol,_Period,EMA_Longa,0,MODE_EMA,PRICE_CLOSE);
h_rsi =iRSI(_Symbol,_Period,RSI_Periodo,PRICE_CLOSE);
h_macd =iMACD(_Symbol,_Period,MACD_Fast,MACD_Slow,MACD_Sinal,PRICE_CLOSE);
se(h_ema20==INVALID_HANDLE || h_ema50==INVALID_HANDLE || h_ema200==INVALID_HANDLE ||
h_rsi==INVALID_HANDLE || h_macd==INVALID_HANDLE)
{ Print("Erro ao criar indicadores!"); retornar INIT_FAILED; }
retornar INIT_SUCCEEDED;
}
//+------------------------------------------------------------------+
//| FUNÇÃO PRINCIPAL |
//+------------------------------------------------------------------+
void OnTick()
{
// --- VERIFICA POSIÇÕES ABERTAS ---
bool tem_Compra=TemPosicao(POSITION_TYPE_BUY);
bool tem_Venda =TemPosicao(POSITION_TYPE_SELL);
// --- PEGA VALORES DOS INDICADORES ---
double e20=GetBufferValue(h_ema20,1);
double e50=GetBufferValue(h_ema50,1);
double e200=GetBufferValue(h_ema200,1);
double e20_ant=GetBufferValue(h_ema20,2);
double e50_ant=GetBufferValue(h_ema50,2);
double rsi=GetBufferValue(h_rsi,1);
double rsi_ant=GetBufferValue(h_rsi,2);
double macd_linha=GetBufferValue(h_macd,0,1);
double macd_sinal=GetBufferValue(h_macd,1,1);
double macd_linha_ant=GetBufferValue(h_macd,0,2);
double macd_sinal_ant=GetBufferValue(h_macd,1,2);
double fech=symbol_info.Close(1);
double ask=symbol_info.Ask();
double bid=symbol_info.Bid();
// --- SINAIS ---
bool SINAL_COMPRA=falso, SINAL_VENDA=falso;
// COMPRA
bool c1=(fech>e20 && fech>e50 && fech>e200);
bool c2=(e20>e50 && e20_ant<=e50_ant);
bool c3=(macd_linha>macd_sinal && macd_linha_ant<=macd_sinal_ant);
bool c4=(rsi>RSI_Sobrevenda && rsi_ant<=RSI_Sobrevenda && rsi<RSI_Sobrecompra);
SINAL_COMPRA=c1 && c2 && c3 && c4 && Permitir_Compra;
// VENDA
bool v1=(fech<e20 && fech<e50 && fech<e200);
bool v2=(e20<e50 && e20_ant>=e50_ant);
bool v3=(macd_linha<macd_sinal && macd_linha_ant>=macd_sinal_ant);
bool v4=(rsi<RSI_Sobrecompra && rsi_ant>=RSI_Sobrecompra && rsi>RSI_Sobrevenda);
SINAL_VENDA=v1 && v2 && v3 && v4 && Permitir_Venda;
// --- FECHA SE SINAL OPOSTO ---
se(Fechar_Sinal_Oposto)
{
if(SINAL_COMPRA && tem_Venda) FecharPosicao(POSITION_TYPE_SELL);
if(SINAL_VENDA && tem_Compra) FecharPosicao(POSITION_TYPE_BUY);
}
// --- EXECUTA OPERAÇÕES ---
if(SINAL_COMPRA && !tem_Compra)
{
lote duplo = LoteCalcular();
double sl=ask-Stop_Loss_Pips*ponto;
double tp=ask+Take_Profit_Pips*ponto;
if(trade.Buy(lote,_Symbol,ask,sl,tp,"Sistema CB - COMPRA"))
Print("✅ COMPRA ABERTA — Lote: ",lote);
senão Print("ERRO COMPRA: ",GetLastError());
}
se(SINAL_VENDA && !tem_Venda)
{
lote duplo = LoteCalcular();
double sl=bid+Stop_Loss_Pips*ponto;
double tp=bid-Take_Profit_Pips*ponto;
if(trade.Sell(lote,_Symbol,bid,sl,tp,"Sistema CB - VENDA"))
Print("🔴 VENDA ABERTA — Lote: ",lote);
senão Print("ERRO VENDA: ",GetLastError());
}
}
//+------------------------------------------------------------------+
//| FUNÇÕES AUXILIARES |
//+------------------------------------------------------------------+
double GetBufferValue(int handle, int shift, int buffer_idx=0)
{
double val[]; ArraySetAsSeries(val,true);
if(CopyBuffer(handle,buffer_idx,shift,1,val)<=0) return 0.0;
retornar val[0];
}
double CalcularLote()
{
if(!Usar_Lote_Auto) return NormalizeDouble(Lote_Fixo,2);
saldo duplo = AccountInfoDouble(ACCOUNT_BALANCE);
duplo risco=saldo*(Risco_Por_Operacao/100.0);
double lote=risco/(Stop_Loss_Pips*10.0); // 1 lote = ~$10/pip
lote=NormalizeDouble(lote,2);
se (lote < 0,01) lote = 0,01;
if(lote>symbol_info.LotsMax()) lote=symbol_info.LotsMax();
lote de retorno;
}
bool TemPosicao(ENUM_POSITION_TYPE tipo)
{
para(int i=0; i<PositionsTotal(); i++)
{
ulong ticket=PositionGetTicket(i);
se(PositionSelectByTicket(ticket))
{
se(PositionGetString(POSITION_SYMBOL)==_Symbol &&
PositionGetInteger(POSITION_MAGIC)==Magic_Number &&
Se PositionGetInteger(POSITION_TYPE)==tipo) retornar verdadeiro;
}
}
retornar falso;
}
void FecharPosicao(ENUM_POSITION_TYPE tipo)
{
for(int i=PositionsTotal()-1; i>=0; i--)
{
ulong ticket=PositionGetTicket(i);
se(PositionSelectByTicket(ticket))
{
se(PositionGetString(POSITION_SYMBOL)==_Symbol &&
PositionGetInteger(POSITION_MAGIC)==Magic_Number &&
PositionGetInteger(POSITION_TYPE)==tipo)
{
ulong pos_ticket=PositionGetInteger(POSITION_TICKET);
double lote=PositionGetDouble(POSITION_VOLUME);
negociação.Fechar(pos_ticket,lote);
Print("🔒 POSIÇÃO FECHADA");
}
}
}
}
void OnDeinit(const int reason)
{
if(h_ema20!=INVALID_HANDLE) IndicatorRelease(h_ema20);
if(h_ema50!=INVALID_HANDLE) IndicatorRelease(h_ema50);
if(h_ema200!=INVALID_HANDLE) IndicatorRelease(h_ema200);
if(h_rsi!=INVALID_HANDLE) IndicatorRelease(h_rsi);
if(h_macd!=INVALID_HANDLE) IndicatorRelease(h_macd);
}
Responded
1
Rating
Projects
2
0%
Arbitration
1
0%
/
0%
Overdue
0
Free
2
Rating
Projects
507
23%
Arbitration
60
57%
/
25%
Overdue
59
12%
Loaded
3
Rating
Projects
5
40%
Arbitration
0
Overdue
0
Working
Published: 1 code
4
Rating
Projects
4
0%
Arbitration
1
100%
/
0%
Overdue
1
25%
Free
5
Rating
Projects
1
100%
Arbitration
0
Overdue
0
Free
6
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Published: 10 codes
7
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
8
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Working
9
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
10
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Published: 5 codes
11
Rating
Projects
144
46%
Arbitration
20
40%
/
20%
Overdue
32
22%
Free
12
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Loaded
13
Rating
Projects
18
44%
Arbitration
2
50%
/
50%
Overdue
0
Free
14
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
15
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
16
Rating
Projects
90
29%
Arbitration
24
13%
/
58%
Overdue
7
8%
Working
17
Rating
Projects
1
0%
Arbitration
0
Overdue
0
Free
Published: 1 code
Similar orders
Ninjatrader 8 bot development
30+ USD
Hello, I want a simple bot for NinjaTrader8. I need a bot that operates automatically on Nasdaq (NQ/MNQ). Requirements: open buys and sells following a simple trend strategy, configurable stop loss and take profit, risk per trade of 1 to 2% of capital, if it loses 3% in a day, stop trading until the next day. Compatible with backtesting, delivery of the source code and the working bot in NinjaTrader 8. My initial
AI-Powered Gold Analysis Web Platform Development
30 - 300 USD
[8/4/2026 4:54 AM] DR.HassaN: AI Gold Analysis Web Platform Requirements Hello, I would like to build a professional AI-powered web platform dedicated exclusively to Gold (XAU/USD) analysis . This is NOT a trading platform or broker . It is an intelligent analysis platform that provides high-quality trading signals and detailed market analysis. The platform should have a modern, premium design with my own branding
Ema100+Fibo
30+ USD
I need a robot that sends me a notification when the price aligns with the EMA and my Fibonacci levels—using specific Fibonacci settings—and then either opens a trade based on the Fibonacci SL and TP or simply sends me a notification. And I want the robot to run in both the Strategy Tester and on a demo account, so I can test it beforehand
I need a custom technical indicator that generates an equidistant channel with two specific structural features: 1. Vertical Multi-Intervals: The ability to plot more than 5 parallel, able to allow me to put intervals 2. Horizontal Angle Input: The ability to manually input geometric angle to strictly define the horizontal slope of the channel or allow me to pick two points manually. i am looking for something like
//+------------------------------------------------------------------+ //| DX_Structure_H1.mq5 | //| Copyright 2026, Seu Nome | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026" #property link " https://www.mql5.com " #property version "1.00" #property strict // Parâmetros de Entrada input string InpSymbol = "DX.F"; // Nome do Ativo
Hola, traders e inversores: Desarrollamos soluciones de trading algorítmico para MetaTrader 4 y MetaTrader 5. Creamos bots, indicadores y herramientas a medida que convierten estrategias manuales en sistemas automáticos, configurables y orientados a una gestión de riesgo sólida. Hemos trabajado en automatizaciones que integran entradas y salidas por reglas, cálculo de lotaje, control de drawdown, filtros de horario y
> "I am looking for a reliable and profitable Expert Advisor (EA) or trading robot for MetaTrader. The EA should have a proven track record, good risk management, and stable performance in live market conditions. Please share the name of the EA, a brief explanation of how its strategy works, and any relevant performance statistics or backtest reports to help me evaluate it."
I have an MT4 custom indicator (.ex4) that I use regularly, and I would like an identical MT5 version. Important: I do not have the source code (.mq4). I only have the compiled MT4 indicator. I am looking for an experienced MQL developer who can recreate the indicator's functionality and appearance for MT5 by analyzing its behavior. The MT5 version should match the MT4 version as closely as possible, including
I have a technical specification ready for a custom alert indicator in NinjaTrader 8 (NinjaScript / C#). Important clarification: it is NOT an automatic trading bot, it is solely a visual indicator (arrows/lines on the chart) and sound alerts (notifications) based on EMA crossovers and range breakouts (ORB 15m) on lower timeframes for futures (MES). I already have the exact rules written out unambiguously
I'm looking for an experienced NinjaTrader 8 (C#) developer to build a fully automated futures trading strategy. Please apply only if you have proven experience developing and testing NinjaTrader strategies. Project Overview Develop a fully automated NinjaTrader 8 strategy. Designed for Apex funded and evaluation accounts. Primary instruments: NQ/MNQ Futures (with flexibility to support other futures later). Trading
Project information
Budget
50+ USD
Deadline
to 365 day(s)
Customer
Placed orders1
Arbitrage count0