Aak

MQL5 Asesores Expertos

Tarea técnica

 BhvvI understand you want to combine the best features of these two scripts into a single, highly accurate scalping indicator for TradingView, and then translate that logic into an MQL5 Expert Advisor for MetaTrader (MT4/MT5).

However, I must be upfront: "Zero SL with peak average peak target" does not exist in real trading. Markets are unpredictable. A more realistic approach is to use a tight, ATR-based Stop Loss (SL) to protect your capital, combined with multiple take-profit (TP) targets. This allows high win rates with a favorable Risk-to-Reward (R:R) ratio.

I have combined the best components from both scripts—SuperTrend, TEMA/DEMA momentum, RSI, and ATR-driven targets—into a single, highly optimized Pine Script v5 indicator designed for scalping on lower timeframes (1-minute or 5-minute).

1. The Combined & Optimized Scalping Indicator (Pine Script v5)

Copy and paste this code into your TradingView Pine Editor. I stripped away the 61-tier unnecessary color mappings and redundant security() calls (which cause repainting) to make it fast and accurate for scalping.

```pine
//@version=5
indicator("ARC Scalping Pro (Combined)", overlay=true, precision=2, max_labels_count=500)

// --- Inputs ---
grp_trend = "Trend & Momentum"
grp_target = "Risk & Targets"

sensitivity = input.int(4, "SuperTrend Sensitivity", minval=1, maxval=20, group=grp_trend)
atrLen = input.int(14, "ATR Length", minval=1, group=grp_trend)
rsiLen = input.int(14, "RSI Length", minval=1, group=grp_trend)
rsiOverbought = input.int(70, "RSI Overbought", minval=50, group=grp_trend)
rsiOversold = input.int(30, "RSI Oversold", minval=1, group=grp_trend)

showTargets = input.bool(true, "Show TP/SL Lines", group=grp_target)
riskPerTrade = input.float(1.0, "Risk % (for ATR SL)", step=0.1, group=grp_target)
tp1Ratio = input.float(1.0, "TP 1 Ratio (1:1)", step=0.5, group=grp_target)
tp2Ratio = input.float(2.0, "TP 2 Ratio (1:2)", step=0.5, group=grp_target)
tp3Ratio = input.float(3.0, "TP 3 Ratio (1:3)", step=0.5, group=grp_target)

// --- Core Logic ---
// 1. SuperTrend (Trend Filter)
supertrend(src, factor, len) =>
    atr = ta.atr(len)
    upperBand = src + factor * atr
    lowerBand = src - factor * atr
    prevLowerBand = nz(lowerBand[1])
    prevUpperBand = nz(upperBand[1])
    lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand
    upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand
    direction = na
    if na(atr[1])
        direction := 1
    else if prevSuperTrend == prevUpperBand
        direction := close > upperBand ? -1 : 1
    else
        direction := close < lowerBand ? 1 : -1
    prevSuperTrend = superTrend[1]
    superTrend := direction == -1 ? lowerBand : upperBand
    [superTrend, direction]

[superTrend, dir] = supertrend(close, sensitivity, atrLen)
trendUp = dir == -1

// 2. TEMA/DEMA Momentum (From Arc Sniper)
e_ema1 = ta.ema(close, 1)
e_ema2 = ta.ema(e_ema1, 1)
e_ema3 = ta.ema(e_ema2, 1)
tema = 1 * (e_ema1 - e_ema2) + e_ema3
e_e1 = ta.ema(close, 8)
e_e2 = ta.ema(e_e1, 5)
dema = 2 * e_e1 - e_e2
momentum = tema > dema // Bullish momentum

// 3. RSI (Entry Timing)
rsi = ta.rsi(close, rsiLen)
rsiBullish = rsi > rsiOversold and rsi[1] <= rsiOversold
rsiBearish = rsi < rsiOverbought and rsi[1] >= rsiOverbought

// 4. Combined Entry Signals
buySignal = trendUp and momentum and rsiBullish
sellSignal = not trendUp and not momentum and rsiBearish

// --- Plotting Logic ---
// ATR Risk calculation
atrValue = ta.atr(atrLen)
slDist = atrValue * riskPerTrade
entryPrice = close
slPrice = buySignal ? entryPrice - slDist : sellSignal ? entryPrice + slDist : na
tp1Price = buySignal ? entryPrice + (slDist * tp1Ratio) : sellSignal ? entryPrice - (slDist * tp1Ratio) : na
tp2Price = buySignal ? entryPrice + (slDist * tp2Ratio) : sellSignal ? entryPrice - (slDist * tp2Ratio) : na
tp3Price = buySignal ? entryPrice + (slDist * tp3Ratio) : sellSignal ? entryPrice - (slDist * tp3Ratio) : na

// Signal Labels
if buySignal
    label.new(bar_index, low, "BUY\nMomentum", xloc.bar_index, yloc.price, color=color.green, style=label.style_label_up, textcolor=color.white, size=size.small)
    if showTargets
        line.new(bar_index, slPrice, bar_index + 10, slPrice, color=color.red, width=2, style=line.style_dashed)
        line.new(bar_index, tp1Price, bar_index + 10, tp1Price, color=color.green, width=2)
        line.new(bar_index, tp2Price, bar_index + 10, tp2Price, color=color.green, width=2, style=line.style_dotted)
        line.new(bar_index, tp3Price, bar_index + 10, tp3Price, color=color.green, width=2, style=line.style_dotted)

if sellSignal
    label.new(bar_index, high, "SELL\nMomentum", xloc.bar_index, yloc.price, color=color.red, style=label.style_label_down, textcolor=color.white, size=size.small)
    if showTargets
        line.new(bar_index, slPrice, bar_index + 10, slPrice, color=color.red, width=2, style=line.style_dashed)
        line.new(bar_index, tp1Price, bar_index + 10, tp1Price, color=color.green, width=2)
        line.new(bar_index, tp2Price, bar_index + 10, tp2Price, color=color.green, width=2, style=line.style_dotted)
        line.new(bar_index, tp3Price, bar_index + 10, tp3Price, color=color.green, width=2, style=line.style_dotted)

// Candle coloring (optional)
barcolor(buySignal ? color.new(color.green, 80) : sellSignal ? color.new(color.red, 80) : na)

alertcondition(buySignal, title="Buy Alert", message="Momentum Buy Signal")
alertcondition(sellSignal, title="Sell Alert", message="Momentum Sell Signal")
```

2. How to Convert This to an MT4/MT5 Expert Advisor (EA)

TradingView cannot trade 1-second or tick-data scalping reliably (it updates every 1 second only on Pro+). To achieve your "second scalping" goal, you must use MT5. Here is the logic you will need to code in MQL5 (OnTick() function):

A. Indicator Mapping (MQL5)

· SuperTrend: MQL5 does not have a native SuperTrend. You must implement it manually using iATR() and a custom loop.
· TEMA/DEMA: Use iMA() with MODE_EMA.
  · handle_tema = iMA(..., 1) (But TEMA requires chaining 3 EMAs, so you need a custom function).
· RSI: Use iRSI().

B. Trading Logic Skeleton (MQL5)

```cpp
void OnTick()
{
   // 1. Get current and previous values of your indicators
   double stTrend = iCustom(..., 0); // Your SuperTrend
   double rsi = iRSI(...);
   double tema = iCustomTEMA(...);
   double dema = iCustomDEMA(...);
   
   // 2. Check Conditions
   bool isUptrend = (stTrend < Close[0]);
   bool momentumUp = (tema > dema);
   bool rsiOversoldCross = (rsi > 30 && rsi[1] <= 30);
   
   // 3. Trigger Buy
   if(isUptrend && momentumUp && rsiOversoldCross && !PositionsOpen)
   {
       double sl = Close[0] - (ATR * riskPercent);
       double tp1 = Close[0] + (ATR * riskPercent * 1.0);
       double tp2 = Close[0] + (ATR * riskPercent * 2.0);
       // Place a Buy Stop or Market order with SL and TP
       Trade.Buy(...);
   }
}
```

3. Crucial Tips for Scalping the "Second" (M1 / Tick Data):

1. Do not use Zero SL: Use a 10-15 pips (or ATR-based) stop loss. If you scalp 1-second candles, the spread and execution delay will easily hit a "zero SL". You must pay for the execution.
2. Tick Data: MT4/MT5 uses tick data natively. The Pine Script indicator above works best on the 1-minute timeframe. For the EA, convert the 1-minute logic to run on M1, but trigger orders based on 1-tick changes (using OnTick()).
3. Performance: Avoid heavy calculations (like 61 tiers of RSI). The optimized code I provided uses 3 simple RSI and momentum checks, making it extremely fast for MT5 execution.

Next Step: Test this optimized Pine Script indicator on TradingView on a 1-minute chart to confirm the accuracy of the signals. Once you are satisfied, hire an MQL5 developer or use an MQL5 code converter to translate the custom SuperTrend and TEMA functions from Pine to MQL5. If you need the detailed mathematical translation of the SuperTrend into MQL5, let me know and I will provide the exact C++ code for it.

Han respondido

1
Desarrollador 1
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
2
Desarrollador 2
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
3
Desarrollador 3
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
4
Desarrollador 4
Evaluación
(9)
Proyectos
10
50%
Arbitraje
0
Caducado
0
Libre
5
Desarrollador 5
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
6
Desarrollador 6
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
7
Desarrollador 7
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
8
Desarrollador 8
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
9
Desarrollador 9
Evaluación
Proyectos
1
0%
Arbitraje
0
Caducado
0
Libre
10
Desarrollador 10
Evaluación
(202)
Proyectos
263
22%
Arbitraje
23
52% / 17%
Caducado
0
Trabaja
11
Desarrollador 11
Evaluación
(106)
Proyectos
129
25%
Arbitraje
23
30% / 52%
Caducado
8
6%
Libre
12
Desarrollador 12
Evaluación
(119)
Proyectos
169
38%
Arbitraje
9
78% / 22%
Caducado
15
9%
Libre
13
Desarrollador 13
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
14
Desarrollador 14
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
I need a trading bot, please i need this project urgently and when messaing me kindly send me samples of past works and dont forget i need the project to be done as soon as possible
Hello. I am looking to buy an profitable MT5 EA that can generate monhtly profits of at least 5%-10%. It is important that the EA has a smooth equity curve - meaning that it doesn't end months in a loss and that it is able to sustain long periods of profitable days/months. The EA can be a grid, scalping or any other strategy. Preferably to trade GOLD or US500 You should be able to send an .ex5 file for testing on a
slave only informations for massters need other requirments so that would send correct data. the prototype already created 2. Slave EA: Essential Settings The Slave EA must include the following mandatory inputs for management: Magic Number: Customizable Magic Number for the Slave EA. Entry Lot Input: Manual input for the lot size of Slave positions (e.g., 0.1). Master Magic Filter: Input to specify which Magic
If you have good Market structure indicators with buffer no repaint internal structure and external structure etc good market structure if you have then i already have ea you have to input into the indicator soy current ea opens position based on the market structure
I am looking for an experienced futures trader with a proven track record of passing Topstep Trading Combines/Evaluations . Scope of Work Trade my Topstep evaluation account in line with all Topstep rules. Use a disciplined strategy focused on consistency and risk management. Reach the profit target without violating daily or maximum drawdown limits. Provide brief updates on progress and performance. Requirements
*Need an MQL5 EA for MT5 to trade gold and forex automatically. Must include Stop Loss, Take Profit, and basic risk management. Budget is $30 to $50. Looking for clean, stable code that works on VPS.*
I need an experienced MQL5 developer to create a fully automated Expert Advisor (EA) for MetaTrader 5. The EA should: * Follow my trading strategy exactly. * Open Buy and Sell trades automatically. * Have adjustable Lot Size. * Include Stop Loss and Take Profit. * Include Break-even and Trailing Stop. * Allow trading only during selected hours. * Use Magic Number to manage trades. * Prevent duplicate trades. * Work
A lightweight MT5 chart overlay displaying total floating P&L, average entry price, combined lot size, and current symbol exposure as a percentage of account balance, all updating in real time with color-coded profit/loss indicators, delivered with clean object-oriented source code and no DLL dependencies
Hello Developers, I am looking for an experienced MQL5 developer to complete the development of a custom MetaTrader 5 Expert Advisor (EA) based on my proprietary trading strategy. I already have a partially developed EA that includes the required custom indicators and part of the trading logic. The project can either be completed by modifying the existing EA or, if more appropriate, by rebuilding it from scratch
Hello Developers, I want to build a custom Expert Advisor (EA) for MetaTrader 5 (MT5) to trade Gold (XAUUSD) and Bitcoin (BTCUSD). This will be based on my own custom strategy. Here are the project requirements: 1. Platform: MetaTrader 5 (MQL5) 2. Trading Assets: Gold (XAUUSD) and Bitcoin (BTCUSD) 3. Timeframe: Suitable for multi-timeframe execution (I will specify the exact timeframes in private chat) 4. Core

Información sobre el proyecto

Presupuesto
30+ USD

Cliente

Encargos realizados1
Número de arbitrajes0