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
(48)
Progetti
61
33%
Arbitraggio
0
In ritardo
3
5%
In elaborazione
2
Sviluppatore 2
Valutazioni
(252)
Progetti
570
36%
Arbitraggio
64
20% / 58%
In ritardo
147
26%
Gratuito
3
Sviluppatore 3
Valutazioni
(2)
Progetti
1
0%
Arbitraggio
2
0% / 0%
In ritardo
0
In elaborazione
4
Sviluppatore 4
Valutazioni
(138)
Progetti
199
80%
Arbitraggio
17
29% / 47%
In ritardo
10
5%
In elaborazione
5
Sviluppatore 5
Valutazioni
(8)
Progetti
7
43%
Arbitraggio
1
0% / 0%
In ritardo
2
29%
Caricato
6
Sviluppatore 6
Valutazioni
(281)
Progetti
421
63%
Arbitraggio
5
40% / 0%
In ritardo
4
1%
Gratuito
7
Sviluppatore 7
Valutazioni
(177)
Progetti
226
58%
Arbitraggio
7
29% / 29%
In ritardo
7
3%
Gratuito
8
Sviluppatore 8
Valutazioni
(507)
Progetti
762
63%
Arbitraggio
33
27% / 45%
In ritardo
23
3%
Gratuito
9
Sviluppatore 9
Valutazioni
(18)
Progetti
27
70%
Arbitraggio
0
In ritardo
1
4%
Caricato
10
Sviluppatore 10
Valutazioni
(562)
Progetti
929
48%
Arbitraggio
301
59% / 25%
In ritardo
123
13%
Caricato
Ordini simili
I have mt4 indicator that is working perfectly but I want to convert it into tradingview strategy. Can I get an expert to get this done for me? I want the strategy to work perfectly on Tradingview
Hello I am new to MT4/MT5, I previously traded for a company with their own internal execution platform. I am looking for someone who can help me understand MT5, how to set up charts, indicators, advisors and back-testing etc.. basically a intro to a new user. I am particularly interested in learning is it possible to trade/execute spreads via MT5 - ie simultaneously buy MSFT and sell DELL, and when you trade out you
Am nevoie de o conversie a unui EA din mql4 in mql5. La final sa fie testata, compilata si rezultatul sa nu aiba erori. Modificarea parametrilor sa se faca dint-un fisier cu extensia txt. Am eu modelul Hi. I need a conversion of an EA from mql4 to mql5. At the end, it should be tested, compiled and the result should have no errors. Modifying the parameters should be done from a file with the extension txt. I have the
Hello, I am looking for someone to convert my MQL4 code project to MQL5. A brief description of my current strategy: MT4 'Spreadsheet' EA collects data from 28 FX currency pairs -> sends it to Excel, then Excel calculates and makes a decision -> Excel sends a signal to MT4 'Trading' EA and manages trades I want the MT4 EA to be converted into MT5. For Back testing purposes, I want to withdraw from using Excel and let
I wanted to convert from mt4 to Ctrader Cbot and you want a particular option/feature to work as a bot. A nd can you update this point: the option to check the account name/number on which the CBOT will work, if the wrong account number is given the CBOT should not work
I want to develop a NinjaTrader automated strategy that has a high win rate for trading futures. So the strategy will automatically enter and exit for an account. Do you have any experience with this? If so, can you please share some past results
👋 Hey can you help me to convert mt4 to ctrader cbot? Options Required along with the conversion from given MQL4 source code to Ctrader Cbot just need one option on top of converting mt4 to cbot need an option to run cbot in selected direction with options as Buy/Sell/Buy-and-Sell
I have a strategy on Tradingview but I want to convert it to either ctrader or mt4. I need an expert developer to help me get this done. Let me know if you can do this. Thanks
MetaTrader MT4 to MT5 Conversion I'm on the lookout for a skilled developer proficient in MetaTrader who can assist me in converting my custom indicators and Expert Advisors (EAs) from MT4 to MT5. The primary goal of this project is to ensure that my tools are seamlessly compatible with both platforms. Key Requirements: - Proven experience in MetaTrader programming - A deep understanding of the differences between
Hello Developer, I am Darshan Galani. i want to Convert Tradingview Indicator to MQ4 & MQ5 file.i also want to source code that must be easy to understand. TradingView Indicator: LuxAlgo Trendlines with Breaks

Informazioni sul progetto

Budget
30+ USD
IVA (21%): 6.3 USD
Totale: 36.3 USD
Per lo sviluppatore
27 USD
Scadenze
a 2 giorno(i)