Convert pinescript to mq5

MQL5 Göstergeler Dönüştürme

İş tamamlandı

Tamamlanma süresi: 3 dakika
Müşteri tarafından geri bildirim
Uno de los mejores programadores de esta web. Con solo leer sus códigos ya puedo saber que se trata de él. Muchas gracias.
Geliştirici tarafından geri bildirim
Excelente cliente. Especificaciones claras y rápido pago. Gracias.

İş Gereklilikleri

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);
  }
//+------------------------------------------------------------------+


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(48)
Projeler
61
33%
Arabuluculuk
0
Süresi dolmuş
3
5%
Çalışıyor
2
Geliştirici 2
Derecelendirme
(252)
Projeler
570
36%
Arabuluculuk
64
20% / 58%
Süresi dolmuş
147
26%
Ücretsiz
3
Geliştirici 3
Derecelendirme
(2)
Projeler
1
0%
Arabuluculuk
2
0% / 0%
Süresi dolmuş
0
Çalışıyor
4
Geliştirici 4
Derecelendirme
(138)
Projeler
199
80%
Arabuluculuk
17
29% / 47%
Süresi dolmuş
10
5%
Çalışıyor
5
Geliştirici 5
Derecelendirme
(8)
Projeler
7
43%
Arabuluculuk
1
0% / 0%
Süresi dolmuş
2
29%
Yüklendi
6
Geliştirici 6
Derecelendirme
(281)
Projeler
421
63%
Arabuluculuk
5
40% / 0%
Süresi dolmuş
4
1%
Ücretsiz
7
Geliştirici 7
Derecelendirme
(177)
Projeler
226
58%
Arabuluculuk
7
29% / 29%
Süresi dolmuş
7
3%
Ücretsiz
8
Geliştirici 8
Derecelendirme
(507)
Projeler
762
63%
Arabuluculuk
33
27% / 45%
Süresi dolmuş
23
3%
Ücretsiz
9
Geliştirici 9
Derecelendirme
(18)
Projeler
27
70%
Arabuluculuk
0
Süresi dolmuş
1
4%
Yüklendi
10
Geliştirici 10
Derecelendirme
(562)
Projeler
929
48%
Arabuluculuk
301
59% / 25%
Süresi dolmuş
123
13%
Yüklendi
Benzer siparişler
Hello I want to buy a strategy and put it in an indicator I have This strategy must be strong, with a profit rate of +90% without repeating or deleting the signal The signal should be 1 minute to 5 minutes maximum I do not have a specific strategy or ideas. You show me your strategies and I am ready to test it send ex4 to test it and videos or images too
Hello guys! I have my own existing EA with mq5 files and like to add on extra functions and features. This is a grid hedging martingale EA. I hope I can get a developer who can do this. 1. Allow input for different magic number for BUY and SELL (Currently, it is using same magic number for both BUY and SELL) Eg: Magic number for BUY = 1, Magic number for SELL = 2 and the same calculation method will apply to the
hi.. i have a pin script (TV) but some lines in the code needs to be fixed,,, i will attach the file thanks very much in advance, Also there will be more project in front, so I need a very dedicated developer
Bom dia, O filtro de notícias do meu EA deixou de funcionar. Algum especialista para trabalhar no filtro de notícias? A ideia é apenas eliminar ordens pendentes ou abertas alguns minutos antes da divulgação de notícias e voltar a abrir alguns minutos depois da divulgação das notícias. Obrigado e cumprimentos, Nelson Dias
Using a tradingview indicator Trend Indicator A (v2.3) to convert it into a Robot. Conditions as follows : Buy when the trend color is green, sell when trend color is red, set stop loss and take profits, risk to reward ratio 1:3 or when the trend color changes, whichever is best based on backtesting. You can add anything that will make the robot works better
I am looking for a skilled developer to create a custom indicator for NinjaTrader with the following specifications: Long (Buy) Signal: First Rule: MACD is positive. Second Rule: A candle changes from red (bearish) to green (bullish). Visual Indication: When the second rule is met, an arrow (color customizable) should appear below the candle to signal a long (buy) position. Short (Sell) Signal: First Rule: MACD is
I have an indicator that shows green and red bar depending on the market trend. The struggle is not just converting the .mql4 to .mql5 but to have the same calculation and resulting the same view as in the metatrader4 I will share the file in the chat discussion :)
I am looking for a developer to assist in testing my Sierra Chart Indicator code. The task involves checking the code for any errors and ensuring it functions perfectly. Your expertise in identifying and fixing potential issues will be invaluable. If you have experience with Sierra Chart and are skilled in debugging, please get in touch. Thank you
Develop ctrader 30+ USD
Hi mate, i would like to make Tensorflow.NET dlls (including Keras.NET, NumSharp etc ) from https://scisharp.github.io/SciSharp compatible with cTrader, so i can develop algos inside cTrader. Can you help? Cheers
Create 1 indicator that identifies when the market is in the range, when the market breaks out of that range , to the up or down side, and then when the market comes back into the range , and when it leaves that range. would like the indicator to be able to scan all symbols/ or have a choice of symbols where this pattern can formed, a dashborad would be nice for clear view. something easy to follow the directions

Proje bilgisi

Bütçe
30+ USD
KDV (21%): 6.3 USD
Toplam: 36.3 USD
Geliştirici için
27 USD
Son teslim tarihi
to 2 gün