Convert Tradingview's (Pinescript) Engulfing Indicators to MQL5 for MetaTrader5 Use

Job finished

Execution time 1 day
Feedback from customer
Excellent work! Perfectly done and quick.
Feedback from employee
Kind and correct customer. great!!!

Specification

For bearish:

//@version=4

study("Engulfing - Bearish", shorttitle = "Engulfing - Bear", overlay=true)


C_DownTrend = true

C_UpTrend = true

var trendRule1 = "SMA50"

var trendRule2 = "SMA50, SMA200"

var trendRule = input(trendRule1, "Detect Trend Based On", options=[trendRule1, trendRule2, "No detection"])


if trendRule == trendRule1

priceAvg = sma(close, 50)

C_DownTrend := close < priceAvg

C_UpTrend := close > priceAvg


if trendRule == trendRule2

sma200 = sma(close, 200)

sma50 = sma(close, 50)

C_DownTrend := close < sma50 and sma50 < sma200

C_UpTrend := close > sma50 and sma50 > sma200

C_Len = 14 // ema depth for bodyAvg

C_ShadowPercent = 5.0 // size of shadows

C_ShadowEqualsPercent = 100.0

C_DojiBodyPercent = 5.0

C_Factor = 2.0 // shows the number of times the shadow dominates the candlestick body


C_BodyHi = max(close, open)

C_BodyLo = min(close, open)

C_Body = C_BodyHi - C_BodyLo

C_BodyAvg = ema(C_Body, C_Len)

C_SmallBody = C_Body < C_BodyAvg

C_LongBody = C_Body > C_BodyAvg

C_UpShadow = high - C_BodyHi

C_DnShadow = C_BodyLo - low

C_HasUpShadow = C_UpShadow > C_ShadowPercent / 100 * C_Body

C_HasDnShadow = C_DnShadow > C_ShadowPercent / 100 * C_Body

C_WhiteBody = open < close

C_BlackBody = open > close

C_Range = high-low

C_IsInsideBar = C_BodyHi[1] > C_BodyHi and C_BodyLo[1] < C_BodyLo

C_BodyMiddle = C_Body / 2 + C_BodyLo

C_ShadowEquals = C_UpShadow == C_DnShadow or (abs(C_UpShadow - C_DnShadow) / C_DnShadow * 100) < C_ShadowEqualsPercent and (abs(C_DnShadow - C_UpShadow) / C_UpShadow * 100) < C_ShadowEqualsPercent

C_IsDojiBody = C_Range > 0 and C_Body <= C_Range * C_DojiBodyPercent / 100

C_Doji = C_IsDojiBody and C_ShadowEquals


patternLabelPosLow = low - (atr(30) * 0.6)

patternLabelPosHigh = high + (atr(30) * 0.6)


C_EngulfingBearishNumberOfCandles = 2

C_EngulfingBearish = C_UpTrend and C_BlackBody and C_LongBody and C_WhiteBody[1] and C_SmallBody[1] and close <= open[1] and open >= close[1] and ( close < open[1] or open > close[1] )

alertcondition(C_EngulfingBearish, title = "Engulfing", message = "New Engulfing - Bearish pattern detected.")

if C_EngulfingBearish

    var ttBearishEngulfing = "Engulfing\nAt the end of a given uptrend, a reversal pattern will most likely appear. During the first day, this candlestick pattern uses a small body. It is then followed by a day where the candle body fully overtakes the body from the day before it and closes in the trend’s opposite direction. Although similar to the outside reversal chart pattern, it is not essential for this pattern to fully overtake the range (high to low), rather only the open and the close."

    label.new(bar_index, patternLabelPosHigh, text="BE", style=label.style_label_down, color = color.red, textcolor=color.white, tooltip = ttBearishEngulfing)

bgcolor(highest(C_EngulfingBearish?1:0, C_EngulfingBearishNumberOfCandles)!=0 ? color.red : na, offset=-(C_EngulfingBearishNumberOfCandles-1))



For bullish:

//@version=4

study("Engulfing - Bullish", shorttitle = "Engulfing - Bull", overlay=true)


C_DownTrend = true

C_UpTrend = true

var trendRule1 = "SMA50"

var trendRule2 = "SMA50, SMA200"

var trendRule = input(trendRule1, "Detect Trend Based On", options=[trendRule1, trendRule2, "No detection"])


if trendRule == trendRule1

priceAvg = sma(close, 50)

C_DownTrend := close < priceAvg

C_UpTrend := close > priceAvg


if trendRule == trendRule2

sma200 = sma(close, 200)

sma50 = sma(close, 50)

C_DownTrend := close < sma50 and sma50 < sma200

C_UpTrend := close > sma50 and sma50 > sma200

C_Len = 14 // ema depth for bodyAvg

C_ShadowPercent = 5.0 // size of shadows

C_ShadowEqualsPercent = 100.0

C_DojiBodyPercent = 5.0

C_Factor = 2.0 // shows the number of times the shadow dominates the candlestick body


C_BodyHi = max(close, open)

C_BodyLo = min(close, open)

C_Body = C_BodyHi - C_BodyLo

C_BodyAvg = ema(C_Body, C_Len)

C_SmallBody = C_Body < C_BodyAvg

C_LongBody = C_Body > C_BodyAvg

C_UpShadow = high - C_BodyHi

C_DnShadow = C_BodyLo - low

C_HasUpShadow = C_UpShadow > C_ShadowPercent / 100 * C_Body

C_HasDnShadow = C_DnShadow > C_ShadowPercent / 100 * C_Body

C_WhiteBody = open < close

C_BlackBody = open > close

C_Range = high-low

C_IsInsideBar = C_BodyHi[1] > C_BodyHi and C_BodyLo[1] < C_BodyLo

C_BodyMiddle = C_Body / 2 + C_BodyLo

C_ShadowEquals = C_UpShadow == C_DnShadow or (abs(C_UpShadow - C_DnShadow) / C_DnShadow * 100) < C_ShadowEqualsPercent and (abs(C_DnShadow - C_UpShadow) / C_UpShadow * 100) < C_ShadowEqualsPercent

C_IsDojiBody = C_Range > 0 and C_Body <= C_Range * C_DojiBodyPercent / 100

C_Doji = C_IsDojiBody and C_ShadowEquals


patternLabelPosLow = low - (atr(30) * 0.6)

patternLabelPosHigh = high + (atr(30) * 0.6)


C_EngulfingBullishNumberOfCandles = 2

C_EngulfingBullish = C_DownTrend and C_WhiteBody and C_LongBody and C_BlackBody[1] and C_SmallBody[1] and close >= open[1] and open <= close[1] and ( close > open[1] or open < close[1] )

alertcondition(C_EngulfingBullish, title = "Engulfing", message = "New Engulfing - Bullish pattern detected.")

if C_EngulfingBullish

    var ttBullishEngulfing = "Engulfing\nAt the end of a given downward trend, there will most likely be a reversal pattern. To distinguish the first day, this candlestick pattern uses a small body, followed by a day where the candle body fully overtakes the body from the day before, and closes in the trend’s opposite direction. Although similar to the outside reversal chart pattern, it is not essential for this pattern to completely overtake the range (high to low), rather only the open and the close."

    label.new(bar_index, patternLabelPosLow, text="BE", style=label.style_label_up, color = color.blue, textcolor=color.white, tooltip = ttBullishEngulfing)

bgcolor(highest(C_EngulfingBullish?1:0, C_EngulfingBullishNumberOfCandles)!=0 ? color.blue : na, offset=-(C_EngulfingBullishNumberOfCandles-1))


*The bullish and bearish indicators shall be combined into one indicator, any object e.g. arrow can be used to indicate the signal, plus integration of alerts. Trend rules not necessary and may be removed for simplicity. Conditions in bold text are the only ones necessary to create arrow object and alert. Thank you.


Responded

1
Developer 1
Rating
(166)
Projects
189
10%
Arbitration
37
38% / 35%
Overdue
5
3%
Working
2
Developer 2
Rating
(126)
Projects
158
35%
Arbitration
4
25% / 50%
Overdue
13
8%
Free
3
Developer 3
Rating
(401)
Projects
529
74%
Arbitration
9
44% / 0%
Overdue
24
5%
Free
Similar orders
I want to develop a fully automated trading robot from scratch. The project includes 8 different pdfs + an introductory instruction pdf. Different pdf deals with different Settings of the EA and/or different St (trading strategies/logics). All Settings & St are to be housed in a single MQL5 EA. The EA is to be attached to a single chart, but it must work on every chart of 63 symbols at a time without any failing or
I am looking for a skilled developer to code my custom Ninjatrader 8 strategy and make it works perfectly. Your expertise is highly needed in this project Kindly reach out to me and let proceed to the project without any further delay thanks
What to update is if i choose to use the indicator i gave then once ea breaks any HL it will mark from the top that cause the break of the HL to the current market once pull back 50% 60% levels above once print the arrow in the both time frame i choose let it open sell the ea already have one arrow indicator once breaks and close candle above LH then it checks the 50% pull back area once pull back from any area the
I need a Trading bot 100 - 500 USD
I need an MQL4 trading bot with this features : 1. Trading 24/7 2. hedged for any unexpected trade reflection or losses 3. connected to the news 4. pauses during the news 5. Always aims for a higher profit 6. Has a footprint tool for an accurate signals 7. never miss any opportunity 8. has turtle trading strategy 9. capable to start trading 1000$ capital 10. it can trade in these charts (EURUSD, GBPUSD, XAUUSD ) 11
I am in need of a developer to connect my TradingView signal with cTrader in other to make receive information and make it work perfectly your expertise is highly needed in this project feel free to reach out to me and let's get started
I want a bot developer deriv He has experience and I want a profitable robot, the profit is higher than the loss Or I want someone to sue with me. I have a profitable robot, but I want another robot or to improve another robot I have
I need a proficient developer to code my NinjaTrader 8 strategy, In order to work perfectly. Your expertise is invaluable for this project's success. Let's collaborate to achieve optimal trading results
I'm looking for a skilled developer to connect my TradingView signals with cTrader, ensuring flawless functionality. Your expertise is essential for this project's success. Let's collaborate to achieve seamless trading automation
Could you please review this code and provide feedback on whether you're able to assist with it? I'm seeking confirmation on whether you're comfortable working on this particular task. Your expertise would be greatly appreciated in ensuring its functionality and efficiency."
Copy Trading 75+ USD
I need an app which will copy trade from a MT4 terminal to other Mt4 terminals on the same desktop PC as well as terminals on a different desktop PC. Latency, slippage will be important

Project information

Budget
30 - 40 USD
For the developer
27 - 36 USD
Deadline
from 2 to 4 day(s)