convert pine script to mql5

 

can anyone help to convert this code to mql5?

//@version=5
indicator("condition counting with valuewhen", overlay = true)

m1 = ta.ema(close, 30)
m2 = ta.ema(close, 100)

plot(m1, color = color.red)
plot(m2, color = color.yellow)

cond = ta.crossover(m1, m2)

var int count = na

if cond
    count := 0
else
    count += 1

since_last = ta.barssince(cond)
since_prev = ta.valuewhen(cond, count[1], 0)
since_prev2 = ta.valuewhen(cond, count[1], 1)

xo_text = "Bars since last crossover : " + str.tostring(since_last) + "\nBars since previous crossover : " + str.tostring(since_prev + since_last + 1) + "\nBars since 2nd previous crossover : " + str.tostring(since_prev2 + since_prev + since_last + 1)

l = label.new(x = bar_index, y = close, style = label.style_label_left, text = xo_text)
label.delete(l[1])
 
  1. Yes.
          How To Ask Questions The Smart Way. (2004)
            Prune pointless queries.
              Only ask questions with yes/no answers if you want “yes” or “no” as the answer.

  2. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
              No free help (2017)

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2018)

    We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
              No free help (2017)

 
tom standly:

can anyone help to convert this code to mql5?

Hi bro,

If you dont know coding it seems freelance only solution or if you understand the lines check this out : https://www.mql5.com/en/articles/3040

Learn how to design different Moving Average systems
Learn how to design different Moving Average systems
  • www.mql5.com
There are many strategies that can be used to filter generated signals based on any strategy, even by using the moving average itself which is the subject of this article. So, the objective of this article is to share with you some of Moving Average Strategies and how to design an algorithmic trading system.
 
tom standly:

can anyone help to convert this code to mql5?

Go to Freelance section, bro.

Reason: