Convert pinescript to mq5

MQL5 Indicatori In conversione

Lavoro terminato

Tempo di esecuzione 3 minuti
Feedback del cliente
Uno de los mejores programadores de esta web. Con solo leer sus códigos ya puedo saber que se trata de él. Muchas gracias.
Feedback del dipendente
Excelente cliente. Especificaciones claras y rápido pago. Gracias.

Specifiche

Hello,

I'm looking for a freelancer with experience in Pinescript and MQ5. I have code for an indicator in Pinescript that I need to convert to MQ5. I've tried doing it myself, but it hasn't worked properly. I need someone who can fix this issue and make sure the indicator works the same on both platforms. At the end of the order, the MQ5 code will be delivered.

Thank you.


Pinescript Code:

//@version=5
indicator("JLC Trend Indicator", overlay=true)

// Define input parameters
DosVelas = input(true, title="Dos Velas")
Bullish_Momentum = input(true, title="Bullish Momentum")
Bearish_Momentum = input(true, title="Bearish Momentum")
Bull_Threshold = input(60, title="Bull Threshold")
End_Bull_Threshold = input(60, title="End of Bull Threshold")
Bear_Threshold = input(40, title="Bear Threshold")
End_Bear_Threshold = input(40, title="End of Bear Threshold")

// Variables for Bullish Momentum
var float BULLlll = na
var float BULLhhh = na
var int BULLTJLC = na
var int BULLRISKUPJLC = na
var int BULLRISKDNJLC = na

// Variables for Bearish Momentum
var float BEARlll = na
var float BEARhhh = na
var int BEARTJLC = na
var int BEARRISKUPJLC = na
var int BEARRISKDNJLC = na

RSIHA = ta.rsi(close, 14)

// Logic for Bearish Momentum condition
if Bearish_Momentum
    if DosVelas
        if not na(RSIHA[2]) and RSIHA[2] > Bear_Threshold and RSIHA[1] < Bear_Threshold and RSIHA < Bear_Threshold
            BEARlll := math.min(low[1], low)
            BEARRISKUPJLC := 1
        if BEARRISKUPJLC == 1 and close < BEARlll
            BEARRISKUPJLC := 0
            BEARTJLC := 1
    else
        if not na(RSIHA[2]) and RSIHA[1] > Bear_Threshold and RSIHA < Bear_Threshold
            BEARTJLC := 1

    if not na(RSIHA[2]) and RSIHA[2] < End_Bear_Threshold and RSIHA[1] > End_Bear_Threshold and RSIHA > End_Bear_Threshold
        BEARhhh := math.max(high[1], high)
        BEARRISKDNJLC := 1
    if BEARRISKDNJLC == 1 and close > BEARhhh
        BEARRISKDNJLC := 0
        BEARTJLC := 0

// Logic for Bullish Momentum condition
if Bullish_Momentum
    if DosVelas
        if not na(RSIHA[2]) and RSIHA[2] < Bull_Threshold and RSIHA[1] > Bull_Threshold and RSIHA > Bull_Threshold
            BULLhhh := math.max(high[1], high)
            BULLRISKUPJLC := 1
        if BULLRISKUPJLC == 1 and close < BULLhhh
            BULLRISKUPJLC := 0
            BULLTJLC := 1
    else
        if not na(RSIHA[2]) and RSIHA[1] < Bull_Threshold and RSIHA > Bull_Threshold
            BULLTJLC := 1

    if not na(RSIHA[2]) and RSIHA[2] > End_Bull_Threshold and RSIHA[1] < End_Bull_Threshold and RSIHA < End_Bull_Threshold
        BULLlll := math.min(low[1], low)
        BULLRISKDNJLC := 1
    if BULLRISKDNJLC == 1 and close > BULLlll
        BULLRISKDNJLC := 0
        BULLTJLC := 0

// Plot TJLC as a red or green histogram
barcolor(BEARTJLC == 1 ? color.new(color.red, 80) : na)
barcolor(BULLTJLC == 1 ? color.new(color.lime, 80) : na)

// Output TJLC to show in the data window
plot(BEARTJLC, title="JLC Bear Trend Indicator", color=color.new(color.red, 0), style=plot.style_histogram)
plot(BULLTJLC, title="JLC Bull Trend Indicator", color=color.new(color.lime, 0), style=plot.style_histogram)


My attempt at MQ5:

//+------------------------------------------------------------------+
//|                                         JLC Trend Indicator.mq5   |
//|                                            https://www.mql5.com |
//+------------------------------------------------------------------+


#property version   "1.00"
#property indicator_separate_window

#property indicator_buffers 4
#property indicator_plots 4

#property indicator_type1 DRAW_HISTOGRAM
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
#property indicator_color1 clrRed
#property indicator_label1 "Bear Trend"

#property indicator_type2 DRAW_HISTOGRAM
#property indicator_style2 STYLE_SOLID
#property indicator_width2 1
#property indicator_color2 clrLime
#property indicator_label2 "Bull Trend"

#property indicator_type3 DRAW_NONE
#property indicator_label3 "BEARTJLC"

#property indicator_type4 DRAW_NONE
#property indicator_label4 "BULLTJLC"

double BearTrendBuffer[];
double BullTrendBuffer[];
double BEARTJLCBuffer[];
double BULLTJLCBuffer[];

int RSI_handle;
double RSI[];

input bool DosVelas = true;
input bool Bullish_Momentum = true;
input bool Bearish_Momentum = true;
input int Bull_Threshold = 60;
input int End_Bull_Threshold = 60;
input int Bear_Threshold = 40;
input int End_Bear_Threshold = 40;

// Variables to apply the logic
double BULLlll, BULLhhh;
double BEARlll, BEARhhh;
int BULLTJLC, BULLRISKUPJLC, BULLRISKDNJLC;
int BEARTJLC, BEARRISKUPJLC, BEARRISKDNJLC;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
// Indicator buffers
   SetIndexBuffer(0, BearTrendBuffer);
   PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, EMPTY_VALUE);
   SetIndexBuffer(1, BullTrendBuffer);
   PlotIndexSetDouble(1, PLOT_EMPTY_VALUE, EMPTY_VALUE);
   SetIndexBuffer(2, BEARTJLCBuffer);
   PlotIndexSetDouble(2, PLOT_EMPTY_VALUE, EMPTY_VALUE);
   SetIndexBuffer(3, BULLTJLCBuffer);
   PlotIndexSetDouble(3, PLOT_EMPTY_VALUE, EMPTY_VALUE);

// Handle for RSI
   RSI_handle = iRSI(NULL, 0, 14, PRICE_CLOSE);
   if(RSI_handle < 0)
     {
      Print("Error creating RSI handle: ", GetLastError());
      return (INIT_FAILED);
     }

   return (INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
// Check if RSI has been calculated
   if(BarsCalculated(RSI_handle) <= 0)
      return (0);

// Copy RSI values
   if(CopyBuffer(RSI_handle, 0, 0, rates_total, RSI) <= 0)
      return (0);

   int limit = rates_total - prev_calculated;
   if(prev_calculated > 0)
      limit++;

// Set series configuration
   ArraySetAsSeries(RSI, true);
   ArraySetAsSeries(BearTrendBuffer, true);
   ArraySetAsSeries(BullTrendBuffer, true);
   ArraySetAsSeries(BEARTJLCBuffer, true);
   ArraySetAsSeries(BULLTJLCBuffer, true);

   for(int i = limit + 1; i >= 2; i++)
     {
      BearTrendBuffer[i] = EMPTY_VALUE;
      BullTrendBuffer[i] = EMPTY_VALUE;
      BEARTJLCBuffer[i] = EMPTY_VALUE;
      BULLTJLCBuffer[i] = EMPTY_VALUE;

      // Reset trend variables
      BEARTJLC = 0;
      BULLTJLC = 0;

      // Bearish Momentum logic
      if(Bearish_Momentum)
        {
         if(DosVelas)
           {
            if(RSI[i+2] > Bear_Threshold && RSI[i+1] < Bear_Threshold && RSI[i] < Bear_Threshold)
              {
               BEARlll = MathMin(low[i+1], low[i]);
               BEARRISKUPJLC = 1;
              }
            if(BEARRISKUPJLC == 1 && close[i] < BEARlll)
              {
               BEARRISKUPJLC = 0;
               BEARTJLC = 1;
              }
           }
         else
           {
            if(RSI[i+1] > Bear_Threshold && RSI[i] < Bear_Threshold)
               BEARTJLC = 1;
           }

         if(RSI[i+2] < End_Bear_Threshold && RSI[i+1] > End_Bear_Threshold && RSI[i] > End_Bear_Threshold)
           {
            BEARhhh = MathMax(high[i+1], high[i]);
            BEARRISKDNJLC = 1;
           }
         if(BEARRISKDNJLC == 1 && close[i] > BEARhhh)
           {
            BEARRISKDNJLC = 0;
            BEARTJLC = 0;
           }
        }

      // Bullish Momentum logic
      if(Bullish_Momentum)
        {
         if(DosVelas)
           {
            if(RSI[i-2] < Bull_Threshold && RSI[i-1] > Bull_Threshold && RSI[i] > Bull_Threshold)
              {
               BULLhhh = MathMax(high[i+1], high[i]);
               BULLRISKUPJLC = 1;
              }
            if(BULLRISKUPJLC == 1 && close[i] < BULLhhh)
              {
               BULLRISKUPJLC = 0;
               BULLTJLC = 1;
              }
           }
         else
           {
            if(RSI[i+1] < Bull_Threshold && RSI[i] > Bull_Threshold)
               BULLTJLC = 1;
           }

         if(RSI[i+2] > End_Bull_Threshold && RSI[i+1] < End_Bull_Threshold && RSI[i] < End_Bull_Threshold)
           {
            BULLlll = MathMin(low[i+1], low[i]);
            BULLRISKDNJLC = 1;
           }
         if(BULLRISKDNJLC == 1 && close[i] > BULLlll)
           {
            BULLRISKDNJLC = 0;
            BULLTJLC = 0;
           }
        }



      // Set buffers
      if(BEARTJLC == 1)
         BearTrendBuffer[i] = 1;
      else
         BearTrendBuffer[i] = 0;

      if(BULLTJLC == 1)
         BullTrendBuffer[i] = 1;
      else
         BullTrendBuffer[i] = 0;

      BEARTJLCBuffer[i] = BEARTJLC;
      BULLTJLCBuffer[i] = BULLTJLC;
     }

   return (rates_total);
  }
//+------------------------------------------------------------------+


Con risposta

1
Sviluppatore 1
Valutazioni
(104)
Progetti
134
43%
Arbitraggio
0
In ritardo
3
2%
In elaborazione
2
Sviluppatore 2
Valutazioni
(268)
Progetti
602
34%
Arbitraggio
65
20% / 57%
In ritardo
147
24%
In elaborazione
Pubblicati: 1 articolo, 22 codici
3
Sviluppatore 3
Valutazioni
(7)
Progetti
8
13%
Arbitraggio
6
33% / 33%
In ritardo
0
Gratuito
4
Sviluppatore 4
Valutazioni
(152)
Progetti
228
80%
Arbitraggio
22
27% / 50%
In ritardo
11
5%
Gratuito
Pubblicati: 24 articoli, 1882 codici
5
Sviluppatore 5
Valutazioni
(12)
Progetti
9
33%
Arbitraggio
11
0% / 100%
In ritardo
2
22%
Gratuito
6
Sviluppatore 6
Valutazioni
(322)
Progetti
499
67%
Arbitraggio
5
40% / 0%
In ritardo
4
1%
Gratuito
Pubblicati: 8 codici
7
Sviluppatore 7
Valutazioni
(279)
Progetti
378
72%
Arbitraggio
19
32% / 47%
In ritardo
16
4%
Gratuito
Pubblicati: 15 codici
8
Sviluppatore 8
Valutazioni
(549)
Progetti
836
61%
Arbitraggio
33
27% / 45%
In ritardo
24
3%
In elaborazione
Pubblicati: 1 codice
9
Sviluppatore 9
Valutazioni
(40)
Progetti
59
85%
Arbitraggio
0
In ritardo
1
2%
Gratuito
Pubblicati: 2 codici
10
Sviluppatore 10
Valutazioni
(574)
Progetti
945
47%
Arbitraggio
309
58% / 27%
In ritardo
125
13%
Gratuito
Ordini simili
Version document : 1.0 Plateforme : TradingView Langage : Pine Script v6 Type : Indicateur d'analyse et d'aide à la décision (non-exécutant) 1. Présentation du projet Nom du produit ONYX SR V2 — Intelligent Support & Resistance Scalping System Objectif Créer un indicateur TradingView capable d'identifier automatiquement des opportunités de scalping basées sur : supports et résistances dynamiques ; action du prix ;
I have a EA/indicator that I want built. I should say 1st off dont know how to code myself so I will be using AI to verify that the source code is complete and matches the documents spec or if better so if you can not truly do the job do not waste either of out time. This is a idea I came.up wit and used AI to produce a framework for it.... and of course AI isn't 100% accurate so I need a knowledgeable quantitative
TumiiFX 30 - 20000 USD
1. Use two EMAs: 20 and 50. If EMA 20 is above EMA 50 → uptrend (look for buys) If EMA 20 is below EMA 50 → downtrend (look for sells) 2. Wait for a pullback into the area between the two EMAs. - For buys: price must touch or move between EMA 20 and EMA 50 during the last few candles. - For stils: same idea, but in a downtrend. 3. Entry signal: Buy: a bullish engulfing candle in an uptrend after the pullback
I am looking for an experienced MQL4 developer to build a professional High-Frequency Trading (HFT) / Low-Latency Expert Advisor for MetaTrader 4 (MT4) . The EA will be deployed on an IC Markets Live account and should be optimized for the fastest possible execution using a low-latency VPS located in LD4 or NY4 . The primary instruments will be US30 and XAUUSD (Gold) . The goal is to create an EA capable of
A robot 50+ USD
HIGH-FREQUENCY M5/M15 CONCURRENT ENTRY SNIPER import time class HighFrequencySniper: def __init__(self): self.target_profit = 25.00 # Targeted Delta Move self.max_execution_time = 3600 # 1 Hour Sandbox (Seconds) self.lot_allocation = "CALIBRATED_TO_RISK" def execute_hft_scan(self, current_price, m5_rsi, m15_order_block): print(f"[SCANNING] Current Kernel Metric: ${current_price:.2f
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
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
QUIERO CONSEGUIR EL CODIGO FUENTE DE ESTE INDICADOR QUE ME GUSTA MUCHO TAMBIEN TIENE EL NOMBRE DE ET BANDS O ENTRY EXIT TIMING . no se los componentes pero estas son las imagenes. que mejor lo describen
I am looking to convert my existing TradingView Pine Script (v5) strategy into an MQL5 Expert Advisor (EA) for MetaTrader 5. Strategy Details: Asset: Gold (XAUUSD) Timeframe: 15-minute Strategy Logic: The strategy is based on a breakout concept. Anchor Candle: The base calculation starts from the Specified Candle Entry Window: The EA should only look for entries As Per Indicator Risk Management: The strategy
I want to find a Developer to perform this work and settle payments in this Application. I undertake not to communicate with Applicants anywhere else except this Application, including third-party messengers, personal correspondence or emails. I understand that violators will be banned from publishing Orders in the Freelance

Informazioni sul progetto

Budget
30+ USD
Scadenze
a 2 giorno(i)