Convert TradingView Pine Script Multi Time Frame Heiken Ashi Stategy To MQL5

MQL5 Conversão

Termos de Referência

I am looking for an experienced MQL5 developer to convert a multi-timeframe Heiken Ashi trading strategy, currently written in Pine Script, into MQL5 for use in MetaTrader 5. The strategy involves multiple conditions across different timeframes and includes entry/exit signals, position tracking, and stop loss management.

I will be using this primarily for 15 minute charts on multiple different pairs. Also, as you are working on the conversion, if you see something that will cause the strategy to not preform as intended, you would fix it so it is performing correctly. I'm happy to have a quick video call to walk through the strategy as needed to make sure everything is working properly.

Details of the Pine Script Strategy:

  1. Strategy Overview: The strategy utilizes Heiken Ashi candles across seven different timeframes (15m, 30m, 1h, 2h, 4h, 12h, and 1D) to determine the market trend and make trade decisions. A long position is taken when all Heiken Ashi bars are green, and a short position is taken when all are red.

  2. Position Management: The script includes logic to avoid re-entries while in a position and switches between long and short positions based on the trend change. For example, when all of the Candle Timeframes turn green, it will close out of a short position and take a long position that is roughly 2% of the overall account size. It will then close out that position and take a short position when they all turn red. These orders will take place on the opening of the next candle after changing trend direction to make sure it doesn't get affected by repainted candles during that time frame.

  3. Stop Loss: The strategy employs a stop loss mechanism set at 50% of the entry price for long positions and 150% for short positions.

  4. Trade Visualization: The Pine Script plots shapes on the chart to indicate entry and exit points, which is a feature I would like to retain in the MQL5 conversion but isn't a strict requirement.

  5. Alert System: The current script uses custom alert messages for trade entries and exits. The converted MQL5 code should include similar alert functionality that can be linked to MetaTrader's native alert system.

Specific Requirements:

  1. Multi-Timeframe Analysis: The MQL5 script must accurately perform Heiken Ashi calculations across the specified timeframes and use these for trend determination (I believe there are already indicators that have been programmed that can be used just like TradingView).

  2. Trade Execution: The script should execute buy and sell orders according to the strategy logic, with appropriate checks to prevent duplicate entries.

  3. Stop Loss Management: The converted script should include a stop loss mechanism that triggers an exit at 50% below the entry price for long positions and 50% above the entry price for short positions.

  1. Graphical Elements: Plot arrows or other graphical objects on the chart to visualize entry and exit points.

  2. Notifications: Implement notifications within the MQL5 script that correspond to the strategy's trading actions. These should be configurable to send alerts within MT5

  3. The script must be fully functional and tested in MetaTrader 5 for both backtesting and live trading.

  4. The final product must adhere to best coding practices and performance optimization standards of MQL5.

Deliverables:

  1. A fully functional MQL5 script that replicates the provided Pine Script strategy.
  2. Documentation/commentary within the code explaining the function of each segment.

Optional:

  1. A brief user manual explaining how to apply the strategy in MetaTrader 5, including any necessary setup steps or parameters that need to be configured by the user.
  2. A test report showing the strategy being run in the MetaTrader 5 Strategy Tester, including any relevant performance metrics.
  3. A short video demonstration of the strategy being applied and running in a live environment.

Here is the Pine Script code for reference:

//@version=4
strategy("Multi Time Frame Heiken Ashi Strategy", overlay=true)

// Function to check if Heiken Ashi bar is green on a given timeframe
isGreen(tf) =>
ha = heikinashi(syminfo.tickerid)
[haOpen, haClose] = security(ha, tf, [open, close], lookahead=barmerge.lookahead_on)
haClose > haOpen

// Function to check if Heiken Ashi bar is red on a given timeframe
isRed(tf) =>
ha = heikinashi(syminfo.tickerid)
[haOpen, haClose] = security(ha, tf, [open, close], lookahead=barmerge.lookahead_on)
haClose < haOpen

// Count the number of green Heiken Ashi bars across all timeframes
greenCount() =>
count = 0
count := count + (isGreen("15") ? 1 : 0)
count := count + (isGreen("30") ? 1 : 0)
count := count + (isGreen("60") ? 1 : 0)
count := count + (isGreen("120") ? 1 : 0)
count := count + (isGreen("240") ? 1 : 0)
count := count + (isGreen("720") ? 1 : 0)
count := count + (isGreen("D") ? 1 : 0)
count

// Generate buy and sell conditions for long and short positions
longCondition = greenCount() == 7
shortCondition = greenCount() == 0

// Initialize variables to track positions
var longPosition = false
var shortPosition = false

// Initialize variables for stop loss prices
var float longStopPrice = na
var float shortStopPrice = na

// Plot buy and sell signals for visualization
plotshape(series=longCondition and not longPosition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(series=shortCondition and not shortPosition, title="Short Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
plotshape(series=longCondition and shortPosition, title="Cover Short Signal", location=location.belowbar, color=color.blue, style=shape.xcross, size=size.small)

// Creating Alerts
longstring = "Input your custom alert message here. \n and put {{strategy.order.alert_message}} in Message box."
shortstring = "Input your custom alert message here. \n and put {{strategy.order.alert_message}} in Message box."

long=input(title="Long Alert Message", defval="Long", confirm=false, group="Alert Messages", tooltip=longstring)
short=input(title="Short Alert Message", defval="short", confirm=false, group="Alert Messages", tooltip=shortstring)

if (longCondition and not longPosition)
alert(long)

if (shortCondition and not shortPosition)
alert(short)

// Executing strategy for long and short positions
if (longCondition and not longPosition)
strategy.entry("Long", strategy.long)
longStopPrice := close * 0.50
longPosition := true
shortPosition := false

if (shortCondition and not shortPosition)
strategy.entry("Short", strategy.short)
shortStopPrice := close * 1.50
shortPosition := true
longPosition := false

if (longCondition and shortPosition)
strategy.close("Short")
shortPosition := false

// Managing the stop loss for long and short positions
if (longPosition)
strategy.exit("Long Stop Loss", "Long", stop=longStopPrice)

if (shortPosition)
strategy.exit("Short Stop Loss", "Short", stop=shortStopPrice)





































































































































































































Respondido

1
Desenvolvedor 1
Classificação
(4)
Projetos
4
0%
Arbitragem
2
0% / 100%
Expirado
1
25%
Livre
2
Desenvolvedor 2
Classificação
(43)
Projetos
90
13%
Arbitragem
33
27% / 58%
Expirado
37
41%
Livre
3
Desenvolvedor 3
Classificação
(281)
Projetos
454
39%
Arbitragem
93
42% / 18%
Expirado
73
16%
Ocupado
Publicou: 2 códigos
Pedidos semelhantes
Hello talented developers, I’m actively looking for an expert developer who can quickly and accurately convert an existing MQL4 indicator into Pine Script for TradingView. The indicator is already prepared and ready to share. I need someone who can replicate the logic perfectly in Pine Script, ensuring clean code, full functionality, and reliable results on TradingView. Looking forward to work with the best and
Hello experts, I’m looking for a professional and experienced developer to assist with a project involving the conversion of an existing MQL4 indicator to Pine Script (TradingView). The goal is to replicate the full functionality of the indicator accurately in Pine Script, ensuring that all the signals, logic, and features work seamlessly on TradingView. Clean, optimized code and proper testing are essential
I need a professional developer who we can work on my current project and other project i have in Que. Hello I need exactly that! Already have a mt5 strategy…. I need to convert the same to ninja and TradeLocker let me know price timing and what you need. I need it Asap
I have my own renko chart. When the first block closes above RSi level (X) I want to buy then when the first block closes below rsi level (x) I want the trade to close and a sell to open. When the first block closes below rsi level (x) i want the ea to sell and not close until the first block closes above rsi level (x) then a buy should open If there is a loss, 2 trades should be taken at the same time. A regular
Good day, Im looking for someone who can convert my MQ4 indicator to MQ5. Add some buffers and variables into it that i can use to declare sooner. Attached is the specifications I need. Codes will be sent after accepting the job. If you do not want this, kindly do not bother to message on this job
Good day, Im looking for someone who can convert my MQ4 indicator to MQ5. Add some buffers and variables into it that i can use to declare sooner. I also want someone who can explain to me the codes i am confused on
I have a pine script that I am running on TradingView. I have used the crosstrade software to automatically take the trades on my ninjatrader. The execution delay is making things super difficult. Also, the strategy is taking multiple positions when it hits the entry price twice on the same bar. I’d like to have only one position open each time it hits the entry price on one bar. Can anyone convert my pinescript into
Zigzag 30+ USD
المؤشرات على معالجة مخططات الأسعار أو تسلسلات الأسعار. والغرض من هذه المعالجة هو توفير أداة تحليل فني مرئية. لذلك، عند طلب مؤشر، عليك تقديم إجابات لبعض الأسئلة، مما يساعد المبرمج على
Hello I need exactly that! Already have a mt5 Indicator strategy…. I need to convert the same Indicator to ninja and TradeLocker let me know price timing and what you need Let me know if you can work on this
hello great developer i just want a conversation,I am simply trying to get it work in ninjatrader the same as it would in tradingview just to Simple, Maintain indicator's core functionality and accuracy Clear communication throughout conversion Testing, validation, and one revision included we can start as long as you can maintain indicator's core functionality and accuracy any small changes in visuals can be worked

Informações sobre o projeto

Orçamento
30 - 100 USD
Desenvolvedor
27 - 90 USD