DownloadRe: Already Converted TradingView Indicators to MT4 Indicators

175
Hi Guys, can someone please convert this Scalping Line Indicator to an MT4 indicator It's quite popular, tracked it for a week, but unless you are a premium user changing tf and symbols is irritating.

https://www.tradingview.com/script/irb0NAkB/

So if someone has time please convert it to MT4.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © KivancOzbilgic

//@version=4
study("Scalping Line", overlay=false)
src = input(close, title="Source")
percent = input(1.0,"Percent", type=input.float, step=0.1, minval=0)
mainperiod = input(100,"Main Period")
signalperiod = input(7,"Signal Period")
MA = sma(sma(src, ceil(mainperiod / 2)), floor(mainperiod / 2) + 1)
ssMA = MA>close+MA*percent/100 ? MA : MA<close-MA*percent/100 ? MA : close
signalline = sma(close,signalperiod)
ScalpLine = signalline-ssMA

k1=plot(ScalpLine,"SLI",color.maroon,2)
k2=plot(0,"")

color1= ScalpLine>=0 ? color.green : color.red
fill(k1,k2,color=color1,transp=80)
alertcondition(crossover(ScalpLine,0), title="BUY ALARM!", message="SLI BUY Signal!")
alertcondition(crossunder(ScalpLine,0), title="SELL ALARM!", message="SLI SELL Signal!")


Re: Already Converted TradingView Indicators to MT4 Indicators

176
nwesterhuijs wrote: Wed Nov 09, 2022 3:01 am Not the neatest code yet, but it seems to do the trick:

HOTT_LOTT_005.mq4


And it has a bar overlay with button, so enjoy.


Image



I have not yet tested all the features yet, so if you find a bug let me know.
Hello, Interesting indicator...... I corrected some things whats I know.
You use old averages function, no strict and most of them have array error. I replace some strict averages functions.
Corrected mtf. Look on Icustom and interpolation. old version freez terminal.
Corrected button, old version not delete lines....
You forget line 342 to activated autowidth for candles.

For plotpoint havent idea for now, but I will look on it....
These users thanked the author kvak for the post (total 7):
Jackson Doh, Chickenspicy, Jedidiah, Knight, Krunal Gajjar, Akela, RodrigoRT7

Re: Already Converted TradingView Indicators to MT4 Indicators

177
kvak wrote: Tue Dec 06, 2022 10:22 am Hello, Interesting indicator...... I corrected some things whats I know.
You use old averages function, no strict and most of them have array error. I replace some strict averages functions.
Corrected mtf. Look on Icustom and interpolation. old version freez terminal.
Corrected button, old version not delete lines....
You forget line 342 to activated autowidth for candles.

For plotpoint havent idea for now, but I will look on it....
Image
Hey kvak,
I can't believe you posted this today! I was only working this file yesterday. So glad you fixed the array out of range issue on the EMA derivative averages as couldn't work out how to fix it. I saw the MTF was crashing the terminal with MaType amongst other references missing from the iCustom.

I looked at the original from TV and thought the candles weren't printing on the band cross like they maybe should, so I changed the code around line 540 to 580 and replaced with this:

Code: Select all

state[i] = (i<(Bars-2) ? (Close[i]>HOTT[i]) ? 1 : (Close[i]<LOTT[i]) ? -1 : ((Close[i]>LOTT[i]) && (Close[i]<HOTT[i])) ? 2 : state[i+1] : 0);
I just hashed out the original codes and got rid of the "state [ i ] = -2". They can be easily reinstated. I also added alerts to this.


Please download the indicators 2 posts below. The MTF wasn't working here. Sorry


On a separate note, thanks for covering the G Channel mtf request. I'm still learning mtf so used diffmerge with your update against the original to help understand it better.
Cheers, JD.
These users thanked the author Jackson Doh for the post (total 3):
Chickenspicy, Jedidiah, kvak

Re: Already Converted TradingView Indicators to MT4 Indicators

178
Jackson Doh wrote: Tue Dec 06, 2022 11:39 am Hey kvak,
I can't believe you posted this today! I was only working this file yesterday. So glad you fixed the array out of range issue on the EMA derivative averages as couldn't work out how to fix it. I saw the MTF was crashing the terminal with MaType amongst other references missing from the iCustom.

I looked at the original from TV and thought the candles weren't printing on the band cross like they maybe should, so I changed the code around line 540 to 580 and replaced with this:

Code: Select all

state[i] = (i<(Bars-2) ? (Close[i]>HOTT[i]) ? 1 : (Close[i]<LOTT[i]) ? -1 : ((Close[i]>LOTT[i]) && (Close[i]<HOTT[i])) ? 2 : state[i+1] : 0);
I just hashed out the original codes and got rid of the "state [ i ] = -2". They can be easily reinstated. I also added alerts to this.

Image


HOTT_LOTT_005 (alerts) 1.1.mq4
HOTT_LOTT_005 (alerts) 1.1.ex4

On a separate note, thanks for covering the G Channel mtf request. I'm still learning mtf so used diffmerge with your update against the original to help understand it better.
Cheers, JD.
Ahh, seems I messed up the mtf in my update. I'll try to fix it
These users thanked the author Jackson Doh for the post:
Jedidiah

Re: Already Converted TradingView Indicators to MT4 Indicators

179
Jackson Doh wrote: Tue Dec 06, 2022 11:55 am Ahh, seems I messed up the mtf in my update. I'll try to fix it
MTF appears to be working OK now on this one. Apologies for not testing the original thoroughly.
These users thanked the author Jackson Doh for the post (total 2):
Jedidiah, Akela

Re: Already Converted TradingView Indicators to MT4 Indicators

180
Jackson Doh wrote: Tue Dec 06, 2022 12:02 pm MTF appears to be working OK now on this one. Apologies for not testing the original thoroughly.
HOTT_LOTT_005 (alerts) 1.11.mq4
HOTT_LOTT_005 (alerts) 1.11.ex4
I must have been half asleep when I posted the above. I forgot to copy in a couple of sections for the alerts. Apologies, JD.
These users thanked the author Jackson Doh for the post:
Jedidiah


Who is online

Users browsing this forum: Ahrefs [Bot], alimpe2000, Amazon [Bot], ChatGPT [Bot], Google [Bot], Gosfraba, LUCAS123, Narutopips, specialkey, vvFish and 74 guests