Convert TV Strategy into a Mt4 or Mt5 EA

MQL5 지표 전문가

명시

Hi, I am looking for a developer to convert a TV strategy into a Mt4 or Mt5 EA. The strategy is based on the EMA and the CVD volume indicator. I dont have the Mt4 or Mt5 version of these indicators. Copy the code below and place it in your TV to see the strategy. Other features:

Stop loss - Option to either use pips of my choosing or close on opposite signal appears. 

Take profit -  Option to either use pips of my choosing or close on opposite signal appears. 

EMA Filter - Must have the option to turn off and on and choose the EMA length 

Time Filter 

Trailing Stop - Can be based on pips or any other idea you may have 

Recovery - Martingale - Allow me to choose the lot size it will increase by. It will only kick in if the previous entry or entries close in a loss. It must stop or reset 

Add to winning trade - For example, a buy trade is taken and its in profit, sometimes price pulls back with 2 or more red candles, after this, a green candle must engulf any of the red candles. Once this happens additional buy entries must be taken. Allow me to choose the lot size. 

How It Takes Buy and Sell Entries:

  • Buy Entry Example:

    1. The price candle closes higher than it opened (green candle).
    2. The CVD indicator shows positive net buying (teal candle).
    3. The price is above the EMA, indicating an uptrend.
    4. The price has not crossed above the EMA more than once, and fewer than two buy signals have been generated since the last EMA crossover.
    5. All conditions are met, so the strategy enters a long position.
  • Sell Entry Example:

    1. The price candle closes lower than it opened (red candle).
    2. The CVD indicator shows negative net selling (red candle).
    3. The price is below the EMA, indicating a downtrend.
    4. The price has not crossed below the EMA more than once, and fewer than two sell signals have been generated since the last EMA crossover.
    5. All conditions are met, so the strategy enters a short position.

Summary:

This strategy combines the Cumulative Volume Delta, price action, and an EMA filter to identify trading opportunities aligned with the prevailing trend. The entry limit logic helps avoid overtrading by restricting the number of entries after an EMA crossover, while the option to enable or disable the EMA filter provides flexibility in strategy application. This approach aims to capitalize on strong, confirmed market movements while minimizing false signals.




//@version=5
strategy("CVD with Price Action and EMA Filter", overlay=true)

// Inputs
anchorInput = input.timeframe("1D", "Anchor period")
useCustomTimeframeInput = input.bool(false, "Use custom timeframe")
lowerTimeframeInput = input.timeframe("1", "Timeframe")

// EMA Filter Inputs
useEMAFilter = input.bool(true, "Use EMA Filter")
emaLength = input.int(50, "EMA Length")
emaSource = input.source(close, "EMA Source")

// Function to calculate up and down volume
upAndDownVolume() =>
    posVol = 0.0
    negVol = 0.0
   
    var isBuyVolume = true    

    switch
        close > open     => isBuyVolume := true
        close < open     => isBuyVolume := false
        close > close[1] => isBuyVolume := true
        close < close[1] => isBuyVolume := false

    if isBuyVolume
        posVol += volume
    else
        negVol -= volume

    posVol + negVol

// Determine lower timeframe
var lowerTimeframe = switch
    useCustomTimeframeInput => lowerTimeframeInput
    timeframe.isseconds     => "1S"
    timeframe.isintraday    => "1"
    timeframe.isdaily       => "5"
    => "60"

// Get volume delta for lower timeframe
diffVolArray = request.security_lower_tf(syminfo.tickerid, lowerTimeframe, upAndDownVolume())

// Calculate CVD
getHighLow(arr) =>
    float cumVolume = na
    float maxVolume = na
    float minVolume = na

    for item in arr
        cumVolume := nz(cumVolume) + item
        maxVolume := math.max(nz(maxVolume), cumVolume)
        minVolume := math.min(nz(minVolume), cumVolume)

    [maxVolume, minVolume, cumVolume]

[maxVolume, minVolume, lastVolume] = getHighLow(diffVolArray)

var cumulLastVolume = 0.0
anchorChange = timeframe.change(anchorInput) or (not na(lastVolume) and na(lastVolume[1]))
cumulOpenVolume = anchorChange ? 0.0 : cumulLastVolume[1]
cumulMaxVolume = cumulOpenVolume + maxVolume
cumulMinVolume = cumulOpenVolume + minVolume
cumulLastVolume := cumulOpenVolume + lastVolume

// Determine CVD color
cvdColor = cumulLastVolume >= cumulOpenVolume ? color.teal : color.red

// Plot CVD as candle
hline(0)
plotcandle(cumulOpenVolume, cumulMaxVolume, cumulMinVolume, cumulLastVolume, "CVD", color = cvdColor, bordercolor = cvdColor, wickcolor = cvdColor)

// EMA Calculation
ema = ta.ema(emaSource, emaLength)

// Entry limit logic
var int buyEntryCount = 0
var int sellEntryCount = 0

// Detect EMA cross
emaCrossedUp = ta.crossover(close, ema)
emaCrossedDown = ta.crossunder(close, ema)

if emaCrossedUp or emaCrossedDown
    buyEntryCount := 0
    sellEntryCount := 0

// Trading logic with EMA filter
priceGreen = close > open
priceRed = close < open
cvdGreen = cvdColor == color.teal
cvdRed = cvdColor == color.red

buySignal = priceGreen and cvdGreen
sellSignal = priceRed and cvdRed

if useEMAFilter
    buySignal := buySignal and close > ema and buyEntryCount < 2
    sellSignal := sellSignal and close < ema and sellEntryCount < 2

// Increment entry counts and place trades
if buySignal
    buyEntryCount := buyEntryCount + 1
    strategy.entry("Buy", strategy.long)
if sellSignal
    sellEntryCount := sellEntryCount + 1
    strategy.entry("Sell", strategy.short)

// Plot Buy and Sell signals
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")

// Plot EMA line
plot(useEMAFilter ? ema : na, title="EMA", color=color.blue, linewidth=2)



파일:

응답함

1
개발자 1
등급
(1)
프로젝트
3
0%
중재
0
기한 초과
0
작업중
2
개발자 2
등급
(4)
프로젝트
4
25%
중재
0
기한 초과
0
작업중
3
개발자 3
등급
(21)
프로젝트
25
24%
중재
0
기한 초과
2
8%
작업중
비슷한 주문
Hello, I am looking to make a modification to an indicator so it runs NT8. This is the link to the indicator in question. https://ninjatraderecosystem.com/user-app-share-download/realtime-level-ii-tick-volume/ I also want to know if if will be possible to add drop down boxes so I can change / choose my own colours and halve an option to adjust the width of the side bar regards
I need to fix an indicator that MT5 says is too slow. The message in Expert Tab when the indicator is used inside another indicator through iCustom function is this: "Indicator is too slow 27674 ms. rewrite the indicator, please". So the indicator needs to be fixed to speed it up. I request final source code mql5 file. Thank you Regards
Hello, I am looking for a skilled developer to create an Expert Advisor (EA) using Moving Averages. Brief Task Description: 1. This EA will use the Moving Averages indicator for signals, and its open and close orders will be based on the signal, as well as the “ candlestick behavior of price relative to the moving averages. ” 2. This EA will have a time-based function, subject to the time-frame it is run on. 3. The
Kindly add the following to the parameters: 1. Transfer existing EA parameters to control panel (Not complicated) 2. Add the price value of the SL and TP next to the pips value, currently it is only the pips parameter that is available in the SL and TP, so that when you input the SL and TP in pips, it will give you the price value of the currency the robot is working on. 3. Max Loss balance: When I specify an amount
Hello, I am looking for a skilled developer to create an Expert Advisor (EA) tailored specifically designed to pass High-Frequency Trading (HFT) challenges. The developer must provide the complete source code for the EA, along with screenshots and detailed documentation demonstrating its functionality. If you are interested and capable of taking on this project, please get in touch. Thank you
Market shift or reversal indicator for sell in crash and buy in boom for 1min and 5min timeframe.. Be willing to send demo first to prove competence else don't apply
Equity chart generator 50 - 500 USD
Develop a bot that automatically generates and extracts equity charts, even for mt5 accounts with prior trade history. This chart will show the account’s performance over time, factoring in all previous trades
I want to modify my indicator to make it a scanner so it will be easier and not missed the signal alerted by the indicator for all the available currency no settings will be changed just adding the time frame selection. time frame selection has to have an option to select all timeframe or just the timeframe selected. the job is to make the indicator: 1. make it a scanner (window or table to show all signal produces
I need an expert advisor based on MACD and MA signals. It must have check and handling of trade operations errors. The main criteria for opening and closing positions: ◇Both Main and Signal direction must be shown by Arrows which is going to be for buy and sell positions
Need a programmer 30 - 50 USD
I am seeking an experienced MQL programmer to develop a custom Expert Advisor for MetaTrader 5. The project involves creating a trading strategy that stops trading after 2 consecutive losses until 6 AM the next day. The ideal candidate should have: - Proficiency in MQL5 programming. - Strong understanding of trading strategies and market analysis. - Experience with backtesting and optimizing trading algorithms. If

프로젝트 정보

예산
40+ USD
기한
에서 2 일

고객

(8)
넣은 주문17
중재 수0