Convert Pinescript Code to MT5 Indicator Source Code

MQL5 지표 전문가

작업 종료됨

실행 시간 3 시간
고객의 피드백
Great dev, delivered fast + good communication
피고용인의 피드백
Very nice working experience

명시


Link to External Description: 


Here is the Pinescript code below:

Key Task is to convert from the standard RSI indicator:

HARSI


Steps:

1) Deliver in a quick timeframe - should be straight forward (within 24 - 48 hrs max)

2) May extend to add it in an EA (after the source code is shown). But for now it is just making the indicator the same as the Pinescript version

See the code below:

// This source code is free to use, copy, and alter in any way you choose.
// ...but credit is always nice :)

//@version=4
//@author=JayRogers

study( "HARSI", "HARSI 🐙", false, format.price, 2 )

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// ====== ABOUT THIS INDICATOR                                                //
//                                                                            //
//  - RSI based Heikin Ashi candle oscillator                                 //
//                                                                            //
// ====== ARTICLES and FURTHER READING                                        //
//                                                                            //
//  - https://www.investopedia.com/terms/h/heikinashi.asp                     //
//                                                                            //
//    "Heikin-Ashi is a candlestick pattern technique that aims to reduce     //
//    some of the market noise, creating a chart that highlights trend        //
//    direction better than typical candlestick charts"                       //
//                                                                            //
// ====== REASON FOR STUDY                                                    //
//                                                                            //
//  - Mostly experimental. I wanted to see if I could translate RSI into a    //
//    Heikin Ashi function and retain it's oscillating nature. That goal      //
//    was met more easily than I anticipated with quite delightful results.   //
//                                                                            //
// ====== DISCLAIMER                                                          //
//                                                                            //
//    Any trade decisions you make are entirely your own responsibility.      //
//    I've made an effort to squash all the bugs, but you never know!         //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//                           ====== TOOLTIPS ======                           //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

string TT_HARSI = "Period for the RSI calculations used to generate the"        +
                  "candles. This seperate from the RSI plot/histogram length."

string TT_PBIAS = "Smoothing feature for the OPEN of the HARSI candles."        +
                  "\n\nIncreases bias toward the prior open value which can"    +
                  " help provide better visualisation of trend strength."       +
                  "\n\n** By changing the Open values, High and Low can also"   +
                  " be distorted - however Close will remain unchanged."

string TT_SMRSI = "This option smoothes the RSI in a manner similar to HA"      +
                  " open, but uses the realtime rsi rather than the prior"      +
                  " close value."

string TT_STOCH = "Uses the RSI generated by the above settings, and as such"   +
                  " will be affected by the smoothing option."

string TT_STFIT = "Adjusts the vertical scaling of the stochastic, can help"    +
                  " to prevent distortion of other data in the channel."        +
                  "\n\nHas no impact cross conditions."

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//                            ====== INPUTS ======                            //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

// -- Candle config

string GROUP_CAND = "Config » HARSI Candles"
i_lenHARSI  = input( 14,            "Length",               input.integer,  group = GROUP_CAND,
                  minval = 1, tooltip = TT_HARSI )
i_smoothing = input( 6,             "Open Smoothing",       input.integer,  group = GROUP_CAND,
                  minval = 1, maxval = 100, tooltip = TT_PBIAS )
string INLINE_COL = "Colour Pallette"
i_colUp     = input( color.teal,    "Colour Pallette  ",    input.color,    group = GROUP_CAND, inline = INLINE_COL )
i_colDown   = input( color.red,     " ",                    input.color,    group = GROUP_CAND, inline = INLINE_COL )
i_colWick   = input( color.gray,    " ",                    input.color,    group = GROUP_CAND, inline = INLINE_COL )

// -- RSI plot config

string GROUP_PLOT = "Config » RSI Plot"
i_source    = input( ohlc4,         "Source",               input.source,   group = GROUP_PLOT )
i_lenRSI    = input( 7,             "Length",               input.integer,  group = GROUP_PLOT,
                  minval = 1 )
i_mode      = input( true,          "Smoothed Mode RSI?",   input.bool,     group = GROUP_PLOT,
                  tooltip = TT_SMRSI )
i_showPlot  = input( true,          "Show RSI Plot?",       input.bool,     group = GROUP_PLOT )
i_showHist  = input( true,          "Show RSI Histogram?",  input.bool,     group = GROUP_PLOT )

// -- Stochastic RSI plots config

string GROUP_STOCH = "Config » Stochastic RSI Plot"
string INLINE_STDS = "Stoch Draw States"
i_showStoch = input( false,         "Show Stochastic? ",    input.bool,     group = GROUP_STOCH, inline = INLINE_STDS,
                  tooltip = TT_STOCH )
i_ribbon    = input( true,          "Ribbon?",              input.bool,     group = GROUP_STOCH, inline = INLINE_STDS )
i_smoothK   = input( 3,             "Smoothing K",          input.integer,  group = GROUP_STOCH,
                  minval = 1 )
i_smoothD   = input( 3,             "Smoothing D",          input.integer,  group = GROUP_STOCH,
                  minval = 1 )
i_stochLen  = input( 14,            "Stochastic Length",    input.integer,  group = GROUP_STOCH,
                  minval = 1 )
i_stochFit  = input( 80,            "Stoch Scaling %",      input.integer,  group = GROUP_STOCH,
                  minval = 1, maxval = 100, tooltip = TT_STFIT )

// -- Channel OB/OS config

string GROUP_CHAN = "Config » OB/OS Boundaries"
i_upper     = input( 20,            "OB",                   input.integer,  group = GROUP_CHAN, inline = "OB",
                  minval = 1, maxval = 50 )
i_upperx    = input( 40,            "OB Extreme",           input.integer,  group = GROUP_CHAN, inline = "OB",
                  minval = 1, maxval = 50 )

i_lower     = input( -20,           "OS",                   input.integer,  group = GROUP_CHAN, inline = "OS",
                  minval = -50, maxval = -1 )
i_lowerx    = input( -40,           "OS Extreme",           input.integer,  group = GROUP_CHAN, inline = "OS",
                  minval = -50, maxval = -1 )

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//                          ====== FUNCTIONS ======                           //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

//  zero median rsi helper function, just subtracts 50.
f_zrsi( _source, _length ) => rsi( _source, _length ) - 50

//  zero median stoch helper function, subtracts 50 and includes % scaling
f_zstoch( _source, _length, _smooth, _scale ) =>
    float _zstoch   = stoch( _source, _source, _source, _length) - 50
    float _smoothed = sma( _zstoch, _smooth )
    float _scaled   = ( _smoothed / 100 ) * _scale

//  mode selectable rsi function for standard, or smoothed output
f_rsi( _source, _length, _mode ) =>

    //  get base rsi
    float _zrsi = f_zrsi( _source, _length )

    //  smoothing in a manner similar to HA open, but rather using the realtime
    //  rsi in place of the prior close value.
    var float _smoothed = na
    _smoothed := na( _smoothed[1] ) ? _zrsi : ( _smoothed[1] + _zrsi ) / 2

    //  return the requested mode
    _mode ? _smoothed : _zrsi

//  RSI Heikin-Ashi generation function
f_rsiHeikinAshi( _length ) =>

    //  get close rsi
    float _closeRSI = f_zrsi( close, _length )

    //  emulate "open" simply by taking the previous close rsi value
    float _openRSI  = nz( _closeRSI[1], _closeRSI )

    //  the high and low are tricky, because unlike "high" and "low" by
    //  themselves, the RSI results can overlap each other. So first we just go
    //  ahead and get the raw results for high and low, and then..
    float _highRSI_raw  = f_zrsi( high, _length )
    float _lowRSI_raw   = f_zrsi( low, _length )
    //  ..make sure we use the highest for high, and lowest for low
    float _highRSI  = max( _highRSI_raw, _lowRSI_raw )
    float _lowRSI   = min( _highRSI_raw, _lowRSI_raw )

    //  ha calculation for close
    float _close    = ( _openRSI + _highRSI + _lowRSI + _closeRSI ) / 4

    //  ha calculation for open, standard, and smoothed/lagged
    var float _open = na
    _open  := na( _open[ i_smoothing ] ) ? ( _openRSI + _closeRSI ) / 2 :
              ( ( _open[1] * i_smoothing ) + _close[1] ) / ( i_smoothing + 1 )

    //  ha high and low min-max selections
    float _high     = max( _highRSI, max( _open, _close ) )
    float _low      = min( _lowRSI,  min( _open, _close ) )

    //  return the OHLC values
    [ _open, _high, _low, _close ]

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//                   ====== SERIES, LINES and LABELS ======                   //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

//  standard, or ha smoothed rsi for the line plot and/or histogram
float RSI = f_rsi( i_source, i_lenRSI, i_mode )

//  stoch stuff
float StochK = f_zstoch( RSI, i_stochLen, i_smoothK, i_stochFit )
float StochD = sma( StochK, i_smoothD )

//  get OHLC values to use in the plotcandle()
[ O, H, L, C ] = f_rsiHeikinAshi( i_lenHARSI )

//  candle body colouring
color bodyColour    = C > O ? i_colUp : i_colDown
color wickColour    = i_colWick

//  shadow, invisible
color colShadow     = color.rgb( 0, 0, 0, 20 )
color colNone       = color.rgb( 0, 0, 0, 100 )

//  rsi color
color colRSI        = color.rgb( 250, 200, 50, 0 )

//  stoch ribbon fill
color colStochK     = color.new( #0094FF, 0 )
color colStochD     = color.new( #FF6A00, 0 )
color colStochFill  = StochK >= StochD ? color.new( colStochK, 50 ) : color.new( colStochD, 50 )

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//                     ====== DRAWING and PLOTTING ======                     //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

//  zero median RSI channel hlines
upperx  = hline( i_upperx,  "OB Extreme",   color.new( color.silver, 60 ) )
upper   = hline( i_upper,   "OB",           color.new( color.silver, 80 ) )
median  = hline( 0,         "Median",       color.orange, hline.style_dotted )
lower   = hline( i_lower,   "OS",           color.new( color.silver, 80 ) )
lowerx  = hline( i_lowerx,  "OS Extreme",   color.new( color.silver, 60 ) )

//  channel fill
fill( upper, upperx, color.new( color.red, 90 ),    title = "Background Fill OB" )
fill( upper, lower,  color.new( color.blue, 90 ),   title = "Background Channel" )
fill( lower, lowerx, color.new( color.green, 90 ),  title = "Background Fill OS" )


//  make our HA rsi candles
plotcandle( O, H, L, C, "HARSI", bodyColour, wickColour, bordercolor = bodyColour )

//  RSI overlay plot
plot( i_showPlot ? RSI : na,                    "RSI Shadow",       colShadow,  3 )
plot_rsi    = plot( i_showPlot ? RSI : na,      "RSI Overlay",      colRSI,     1 )

buy = C < O and O > 18 and RSI > i_upper and falling(RSI,1)
sell = C > O and O < -18 and RSI < i_lower and rising(RSI,1)

buy1 = C > O and C < -7 and rising(RSI,2)
sell2 = C < O and C > 7 and falling(RSI,2)


plotshape(sell, style=shape.circle, size=size.tiny, color=color.lime, location =location.bottom)
plotshape(buy, style=shape.circle, size=size.tiny, color=color.red, location =location.top)

plotshape(buy1, style=shape.circle, size=size.tiny, color=color.orange, location =location.bottom)
plotshape(sell2, style=shape.circle, size=size.tiny, color=color.orange, location =location.top)


alertcondition(sell, "Buy")
alertcondition(buy, "Sell")

alertcondition(buy1, "Close Short")
alertcondition(sell2, "Close Long")



// -- PEANUT






 




응답함

1
개발자 1
등급
(19)
프로젝트
22
23%
중재
3
67% / 33%
기한 초과
2
9%
작업중
2
개발자 2
등급
(316)
프로젝트
480
66%
중재
5
40% / 0%
기한 초과
4
1%
무료
게재됨: 8 코드
3
개발자 3
등급
(255)
프로젝트
576
36%
중재
64
20% / 58%
기한 초과
147
26%
무료
게재됨: 1 기고글, 22 코드
4
개발자 4
등급
(152)
프로젝트
163
69%
중재
0
기한 초과
0
무료
5
개발자 5
등급
(132)
프로젝트
178
39%
중재
4
25% / 50%
기한 초과
14
8%
무료
6
개발자 6
등급
(54)
프로젝트
102
23%
중재
12
25% / 17%
기한 초과
13
13%
무료
7
개발자 7
등급
(564)
프로젝트
933
47%
중재
302
59% / 25%
기한 초과
125
13%
작업중
비슷한 주문
i need to convert a TradingView (PineScript) indicator to MQL4 name of the indicator is "Donchian Trend Ribbon" the source code will be below. visuals are important. so make sure the developed indicator will have the visuals all ordinal input should be represented. General conditions write clear and well commented code. delivery should be within 2 days. deliveries are the indicator ex4 and the developed source code
Hi guys My grid EA has some bugs and I would like to figure out, what lead into my losses. I made a document with all the bugs I have found. It must be something with Global Variables and mathematical levels it ignores. The logic behind is very complex and the EA has approx. 4500 lines of code. Requirements: - Math understanding - Understands mql5 and clean coding What does the EA: - It continuously monitors the
Money king Fx 30 - 12000 USD
I want to creat this robot to help me to makes me to be professional trade in this world, it's will be opening order itself and close them and it will be a profitable robot
I have a pine script from tradeview and I'd like you to convert it in js ECMAScript (ES6) so as to use in the trendspider, Please find a link to check which one is it. https://charts.trendspider.com/scripting/docs/#/scripting_language if you are an expert and you can do this work bid
All entry/exit conditions, signal filtering, EMA, ADX, and ATR calculations, as well as confirmation candles, must be implemented without any changes . Signals must appear exactly the same as they do in TradingView: On the same candles , in the same direction . Optimized for detecting spikes/drops in Boom and Crash indices on the M1 timeframe . User-friendly interface: Ability to configure the following parameters
Вот краткое описание задания. Полный документ с техническим заданием (TZ) прилагается во вложении: Советник (EA) уже реализован на платформе MetaTrader 4 и работает на основе дивергенций RSI / MACD с 8 вариантами открытия позиций (1-4 и 1A-4A). Необходимо: Интегрировать внешнюю bridge-версию индикатора “All-in-One Candlestick Pattern Scanner” (Bridge версия) через функцию iCustom() для получения информации о свечных
ASAP assist if you know what to do Multi-Timeframe High/Low Lines Timeframes : Weekly (W1), Daily (D1), 12H (H12) Logic : Draw lines from previous completed candle’s high and low Labels: W1 High @ price , D1 Low @ price , etc. Colors: W1 = Blue D1 = Green H12 = Orange Line Style: customizable via inputs Lines stretch to the right side of the chart Visible on all timeframes (15M, H1, H4, etc.) 2. Stochastic Oscillator
Buna tuturor developerilor romani de pe aici, Am un indicator care functioneaza destul de bine insa cum intotdeauna este loc de mai bine as avea nevoie de niste update uri pentru el. In principiu as vrea sa fie adaugat 2 indicatori noi in logica existenta, primul este CCI al doilea este Accelerator Oscillator. Primul ar trebui sa functioneze in TF current, iar al doilea in TF curent + un TF mai mare. Mai multe
I’m looking for a custom indicator that can scan for ICT Smart Money "Breaker Structures" and alert me when they form. What I Need: The indicator should analyze markets (Oil/Gold/ but mostly Crypto (BTC)) for Breaker Structures—where price breaks a swing high/low but gets rejected, signaling a potential reversal. I primarily use TradingView, so I'd appreciate it if the script is compatible with TradingView and can
Trend ScreenerPRO MT5 30 - 40 USD
I found your indicator in the marketplace. It seems to be exactly what I'm looking for. I would like to buy it and to be personalized for my own use. I'm just trading XAU/USD and follow a very good signal on Telegram, GTMO. I'm very successful with him and all of his followers earning a lot of money. I want to get my own Indikator to confirm his signals for my trades before entering. Can you offer me your indicator

프로젝트 정보

예산
30+ USD
개발자에게
27 USD
기한
 1 일