Linear Regression MT5/MT4 EA from TradingView Indicator (Will consider higher prices)

MQL5 Esperti

Specifiche

I have an indicator on tradingview (pine) that I would like converted into an EA on MT5. Code for the indicator:

//@version=4

study("Linear Regression Trend Channel With Pearson's R", "LRTCWPR", true, format.inherit)

period     = input(     101, "Period"       , input.integer, minval=3)

deviations = input(    2.0, "Deviation(s)" , input.float  , minval=0.1, step=0.1)

extendType = input("Right", "Extend Method", input.string , options=["Right","None"])=="Right" ? extend.right : extend.none

periodMinusOne = period-1

Ex = 0.0, Ey = 0.0, Ex2 = 0.0,Ey2 =0.0, Exy = 0.0, for i=0 to periodMinusOne

    closeI = nz(close[i]), Ex := Ex + i, Ey := Ey + closeI, Ex2 := Ex2 + (i * i),Ey2 := Ey2 + (closeI * closeI), Exy := Exy + (closeI * i)

ExT2 = pow(Ex,2.0) //Sum of X THEN Squared

EyT2 = pow(Ey,2.0) //Sym of Y THEN Squared

PearsonsR = round(-1000000*(Exy - ((Ex*Ey)/period))/(sqrt(Ex2-(ExT2/period))*sqrt(Ey2-(EyT2/period))))/10000

ExEx = Ex * Ex, slope = Ex2==ExEx ? 0.0 : (period * Exy - Ex * Ey) / (period * Ex2 - ExEx)

linearRegression = (Ey - slope * Ex) / period

intercept = linearRegression + bar_index * slope

deviation = 0.0, for i=0 to periodMinusOne

    deviation := deviation + pow(nz(close[i]) - (intercept - slope * (bar_index[i])), 2.0)

deviation := deviations * sqrt(deviation / periodMinusOne)

startingPointY = linearRegression + slope * periodMinusOne

var label pearsonsRLabel = na

label.delete(pearsonsRLabel[1])

pearsonsRLabel := label.new(bar_index[50],sma(close,100)-deviation,text=tostring(PearsonsR), color=color.black,style=label.style_labelup,textcolor=color.white,size=size.large)

var line upperChannelLine = na  , var line medianChannelLine = na  , var line lowerChannelLine = na

line.delete(upperChannelLine[1]), line.delete(medianChannelLine[1]), line.delete(lowerChannelLine[1])

upperChannelLine  := line.new(bar_index - period + 1, startingPointY + deviation, bar_index, linearRegression + deviation, xloc.bar_index, extendType, color.new(#FF0000, 0), line.style_solid , 2)

medianChannelLine := line.new(bar_index - period + 1, startingPointY            , bar_index, linearRegression            , xloc.bar_index, extendType, color.new(#4CAF50, 0), line.style_solid , 2)

lowerChannelLine  := line.new(bar_index - period + 1, startingPointY - deviation, bar_index, linearRegression - deviation, xloc.bar_index, extendType, color.new(#2196F3, 0), line.style_solid , 2)

Con risposta

1
Sviluppatore 1
Valutazioni
(647)
Progetti
1295
67%
Arbitraggio
84
26% / 49%
In ritardo
338
26%
Gratuito
Ordini simili
Description of the ScriptThis script is designed for MetaTrader 4 (MT4) to execute a Buy order based on a re-entry strategy using the BBMA (Bollinger Bands Moving Average) approach. The main timeframe used is H1 (1-hour), and the script employs the Classic Bullish Engulfing pattern as a validation criterion before placing a Buy order.Key Components of the Script:Input Parameters:Lots: Defines the lot size for the
I need an expert to help me with adding more features to my existing mt4 EA I think the addition I want added to this EA is fairly simple--but I don't really understand how programming works, Contact me for a long term work, This is not the only project, I will explain the features in the inbox, Let me know if you can do it
Expert Advisor para operar no par XAU/USD no gráfico de 30 minutos, com as seguintes especificações: Indicadores : Utilize uma mídia móvel simples (SMA) de 72 períodos. Utilize o indicador Money Flow Index (MFI) com um período de 7. Inclui um indicador para marcar suporte e resistência nas últimas duas semanas no gráfico H4. Critérios de Operação : Venda : Execute uma ordem de venda se o preço se poupar no mínimo 800
EA Robot 30 - 500 USD
I Shawn Mametsa wants to creat a robot that will help a lot of people to make money through trading and become successful through trading I want to help those who want to trade but don’t know how to analyse the market
This is a simple Martingale based EA with RSI indicator used as buy/sell order conditions Mandatory Inputs: extern double TakeProfit = 120.0; // self explanatory for first order, for martingale orders it will adjust TP of all orders of the same type (buy / sell) to one, for example if an order opened at 100, 2nd opens at 105, the both of their tps will be at the same point, if an order is manually closed, it will
I need an expert advisor based on supply and demand zones. The zones should be identified automatically with tweakable parameters, but there should be also an option to input my own zones. I need the EA to have capability of opening market positions as well as pending orders. Other requirements: Martingale News filter Time filter Set expiry to zones, to prevent opening positions when price enters old zones
I have an indicator with two lines | want an EA the buy when the fast line crosses the slow line from below one important thing> the slow line must at least a specific distance below the last cross through the fast line from above take profit is between 1 or 3 times more than stoploss the stop loss is the last low the sell order is the opposite for buy Thanks
want to create a EA 1- break out candle ( T F customized) and customized SL TP 2- breakout fib zone 3- supertrend and candle stick patterns 4 Heikein Ashi and Renko charts
**Project Title:** Development of a Complex High-Performance EA for Step Index **Project Overview:** I need an advanced Expert Advisor (EA) for trading the Step Index on MetaTrader 5. The EA should use multiple indicators and advanced risk management techniques to enhance profitability and manage risks effectively. **Trading Strategy Details:** Indicators: - 50-period EMA - 200-period EMA - RSI with 14 periods - MACD
My needs I need powerful robots to avoid losses as well as a business strategy or whether it is buying or selling in the market or any strategy that exists in the business sector

Informazioni sul progetto

Budget
50+ USD
Per lo sviluppatore
45 USD
Scadenze
a 5 giorno(i)