Re: Already Converted TradingView Indicators to MT4 Indicators

511
nine wrote: Thu Dec 19, 2024 3:52 am ok i am going to give this a go
my request is for the bx-trender
kvak wrote: Thu Dec 19, 2024 8:37 am Hello, I made this simple version, for now without T3.
Coming along real nice bros......... have not seen this type of indicator before but its a real good neat project so far!!!
These users thanked the author moey_dw for the post:
kvak
Official Forex-station GIF animator at your service 👨‍⚖️
See a GIF with Forex-station.com on it? I probably made it
The best divergence indicator in the world.
Real news exists: Infowars.com 👈


Re: Already Converted TradingView Indicators to MT4 Indicators

512
Hello Mr Tools and Kvak !
Please convert this indicator to Mt4 !
https://www.tradingview.com/script/t0NM4QnZ/

Reason: It is a good tool to mark a specific date in each month. Let's take example in the case of NFP, we can put the date of Friday of the 1st month.
And also to schedule upcoming events.

Moreover, there was no indicator like this in MT4.

Code: Select all

//@version=5

////////
// Title 
indicator(title='Vertical & Open Lines - Yearly Monthly Weekly Daily [MsF]', shorttitle='YMWD V&O Lines', overlay=true, max_lines_count=500, max_labels_count=500)

////////
// Input values 
// [
iBaseTime = input.time(defval=timestamp('01 Jan 2018 0:00 +0000'), title='Base Time')

yearlyColor = input.color(defval=color.red, title='', inline='year')
iYearly = input.bool(true, title='Show Yearly', inline='year')
hyearlyColor = input.color(defval=color.red, title='', inline='year')
ihYearly = input.bool(false, title='Open Line', inline='year')

monthlyColor = input.color(defval=color.orange, title='', inline='month')
iMonthly = input.bool(true, title='Show Monthly', inline='month')
hmonthlyColor = input.color(defval=color.orange, title='', inline='month')
ihMonthly = input.bool(false, title='Open Line', inline='month')

dailyColor = input.color(defval=color.yellow, title='', inline='day')
iDaily = input.bool(false, title='Show Daily', inline='day')
hdailyColor = input.color(defval=color.yellow, title='', inline='day')
ihDaily = input.bool(false, title='Open Line', inline='day')

weeklyColor = input.color(defval=color.lime, title='', inline='week')
iWeekly = input.bool(false, title='Show Weekly', inline='week')
hweeklyColor = input.color(defval=color.lime, title='', inline='week')
ihWeekly = input.bool(false, title='Open Line', inline='week')

iSelectWeek = input.string(title="Select Week", defval="MON", options=["MON","TUE","WED","THU","FRI","SAT","SUN"])

lineStyle = input.string(title='Vertical Line Style', defval=line.style_dashed, options=[line.style_dotted, line.style_dashed, line.style_solid])
hLineStyle = input.string(title='Horizontal Line Style', defval=line.style_solid, options=[line.style_dotted, line.style_dashed, line.style_solid])
// ]

//////// 
// Preparing
// [
[yearlyTime, yearlyOpen] = request.security(syminfo.tickerid, '12M', [time, open], lookahead=barmerge.lookahead_on)
[monthlyTime, monthlyOpen] = request.security(syminfo.tickerid, 'M', [time, open], lookahead=barmerge.lookahead_on)
[dailyTime, dailyOpen] = request.security(syminfo.tickerid, 'D', [time, open], lookahead=barmerge.lookahead_on)
[weeklyTime, weeklyOpen] = request.security(syminfo.tickerid, 'W', [time, open], lookahead=barmerge.lookahead_on)
// ]

//////// 
// Making
// [
var line hLine_yearly = na
var label hlabel_yearly = na
if iYearly
    var iDrawTimeY_= 0
    yy = year
    mm = month(iBaseTime)
    dd = dayofmonth(iBaseTime)
    hh = hour(iBaseTime)
    m2 = minute(iBaseTime)

    iDrawTime = timestamp(yy, mm, dd, hh, m2)

    // double drawing prevention
    if iDrawTime != iDrawTimeY_ and iDrawTime < timenow
        // Horizontal
        if ihYearly
            line.new(iDrawTimeY_, yearlyOpen, iDrawTime, yearlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hyearlyColor, width=1)
        // Vertical
        line.new(iDrawTime, yearlyOpen, iDrawTime, yearlyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=yearlyColor, width=1)
        iDrawTimeY_ := iDrawTime
    if ihYearly
        line.delete(hLine_yearly)
        label.delete(hlabel_yearly)
        hLine_yearly  := line.new(iDrawTimeY_, yearlyOpen, last_bar_time, yearlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hyearlyColor, width=1)
        hlabel_yearly := label.new(last_bar_index+50, yearlyOpen, "Yearly Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hyearlyColor, size=size.normal)

var line hLine_monthly = na
var label hlabel_monthly = na
if iMonthly
    var iDrawTimeM_= 0
    yy = year
    mm = month
    dd = dayofmonth(iBaseTime)
    hh = hour(iBaseTime)
    m2 = minute(iBaseTime)

    iDrawTime = timestamp(yy, mm, dd, hh, m2)

    // double drawing prevention
    if iDrawTime != iDrawTimeM_ and iDrawTime < timenow
        // Horizontal
        if ihMonthly
            line.new(iDrawTimeM_, monthlyOpen, iDrawTime, monthlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hmonthlyColor, width=1)
        // Vertical
        line.new(iDrawTime, monthlyOpen, iDrawTime, monthlyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=monthlyColor, width=1)
        iDrawTimeM_ := iDrawTime
    if ihMonthly
        line.delete(hLine_monthly)
        label.delete(hlabel_monthly)
        hLine_monthly  := line.new(iDrawTimeM_, monthlyOpen, last_bar_time, monthlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hmonthlyColor, width=1)
        hlabel_monthly := label.new(last_bar_index+50, monthlyOpen, "Monthly Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hmonthlyColor, size=size.normal)

var line hLine_daily = na
var label hlabel_daily = na
// flag for plotshape()
iDspWeekOnDaily=false
if iDaily
    // H4を超える時間足は出力しない
    if timeframe.in_seconds(timeframe.period) <= 14400
        var iDrawTimeD_= 0
        var iOpenD_ = 0.0
        yy = year
        mm = month
        dd = dayofmonth
        hh = hour(iBaseTime)
        m2 = minute(iBaseTime)

        iDrawTime = timestamp(yy, mm, dd, hh, m2)

        hour_j = hour(iDrawTime, "GMT+9")
        dayofweek_j = dayofweek(iDrawTime, "GMT+9")

        iDsp = true
        if dayofweek_j == dayofweek.saturday and hour_j >= 6
            iDsp := false
        else if dayofweek_j == dayofweek.sunday
            iDsp := false
        else if dayofweek_j == dayofweek.monday and hour_j < 7
            iDsp := false

        if syminfo.type == "crypto"
            iDsp := true

        // double drawing prevention
        if iDrawTime != iDrawTimeD_ and iDsp and iDrawTime < timenow 
            // Horizontal
            if ihDaily
                line.new(iDrawTimeD_, iOpenD_, iDrawTime, iOpenD_, xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hdailyColor, width=1)
            // Vertical
            line.new(iDrawTime, dailyOpen, iDrawTime, dailyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=dailyColor, width=1)
            iDspWeekOnDaily:=true
            iDrawTimeD_ := iDrawTime
            iOpenD_     := dailyOpen
        if ihDaily
            line.delete(hLine_daily)
            label.delete(hlabel_daily)
            hLine_daily  := line.new(iDrawTimeD_, dailyOpen, last_bar_time, dailyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hdailyColor, width=1)
            hlabel_daily := label.new(last_bar_index+50, dailyOpen, "Daily Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hdailyColor, size=size.normal)

// Draw a vertical line to display the day of the week below the chart
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.monday,    offset=0, style=shape.diamond, text="MON" , color=color.lime  , location = location.bottom, textcolor=color.lime  )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.tuesday,   offset=0, style=shape.diamond, text="TUE" , color=color.red   , location = location.bottom, textcolor=color.red   )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.wednesday, offset=0, style=shape.diamond, text="WED" , color=color.aqua  , location = location.bottom, textcolor=color.aqua  )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.thursday,  offset=0, style=shape.diamond, text="THU" , color=color.yellow, location = location.bottom, textcolor=color.yellow)
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.friday,    offset=0, style=shape.diamond, text="FRI" , color=color.orange, location = location.bottom, textcolor=color.orange)
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.saturday,  offset=0, style=shape.diamond, text="SAT" , color=color.gray  , location = location.bottom, textcolor=color.gray  )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.sunday,    offset=0, style=shape.diamond, text="SUN" , color=color.gray  , location = location.bottom, textcolor=color.gray  )

var line hLine_weekly = na
var label hlabel_weekly = na
if iWeekly
    // Convert day of week to number
    iDayofweek=iSelectWeek=="SUN"?0:iSelectWeek=="MON"?1:iSelectWeek=="TUE"?2:iSelectWeek=="WED"?3:iSelectWeek=="THU"?4:iSelectWeek=="FRI"?5:iSelectWeek=="SAT"?6:1

    // Selected day of week?
    if dayofweek==iDayofweek and ta.change(dayofweek)
        var iDrawTimeW_ = 0
        yy = year
        mm = month
        dd = dayofmonth
        hh = hour(iBaseTime)
        m2 = minute(iBaseTime)

        iDrawTime = timestamp(yy, mm, dd, hh, m2)

        if iDrawTime != iDrawTimeW_ and iDrawTime < timenow 
            // Horizontal
            if ihWeekly
                line.new(iDrawTimeW_, weeklyOpen[1], iDrawTime, weeklyOpen[1], xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hweeklyColor, width=1)
            // Vertical
            line.new(iDrawTime, weeklyOpen, iDrawTime, weeklyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=weeklyColor, width=1)
            iDrawTimeW_ := iDrawTime
        if ihWeekly
            line.delete(hLine_weekly)
            label.delete(hlabel_weekly)
            // hLine_weekly  := line.new(iDrawTimeW_, weeklyOpen, last_bar_time, weeklyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hweeklyColor, width=1)
            if ta.change(weekofyear)
                hLine_weekly := line.new(na, na, na, na, style=hLineStyle, extend=extend.right, color=hweeklyColor, width=1)
                line.set_xy1(hLine_weekly, bar_index[1], open)
                line.set_xy2(hLine_weekly, bar_index,    open)
            hlabel_weekly := label.new(last_bar_index+50, weeklyOpen, "Weekly Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hweeklyColor, size=size.normal)
// ]



Thanks 😊🙏🏽

Re: Already Converted TradingView Indicators to MT4 Indicators

514
Lwqa wrote: Thu Dec 19, 2024 8:05 pm Hello Mr Tools and Kvak !
Please convert this indicator to Mt4 !
https://www.tradingview.com/script/t0NM4QnZ/

Reason: It is a good tool to mark a specific date in each month. Let's take example in the case of NFP, we can put the date of Friday of the 1st month.
And also to schedule upcoming events.

Moreover, there was no indicator like this in MT4.

Code: Select all

//@version=5

////////
// Title 
indicator(title='Vertical & Open Lines - Yearly Monthly Weekly Daily [MsF]', shorttitle='YMWD V&O Lines', overlay=true, max_lines_count=500, max_labels_count=500)

////////
// Input values 
// [
iBaseTime = input.time(defval=timestamp('01 Jan 2018 0:00 +0000'), title='Base Time')

yearlyColor = input.color(defval=color.red, title='', inline='year')
iYearly = input.bool(true, title='Show Yearly', inline='year')
hyearlyColor = input.color(defval=color.red, title='', inline='year')
ihYearly = input.bool(false, title='Open Line', inline='year')

monthlyColor = input.color(defval=color.orange, title='', inline='month')
iMonthly = input.bool(true, title='Show Monthly', inline='month')
hmonthlyColor = input.color(defval=color.orange, title='', inline='month')
ihMonthly = input.bool(false, title='Open Line', inline='month')

dailyColor = input.color(defval=color.yellow, title='', inline='day')
iDaily = input.bool(false, title='Show Daily', inline='day')
hdailyColor = input.color(defval=color.yellow, title='', inline='day')
ihDaily = input.bool(false, title='Open Line', inline='day')

weeklyColor = input.color(defval=color.lime, title='', inline='week')
iWeekly = input.bool(false, title='Show Weekly', inline='week')
hweeklyColor = input.color(defval=color.lime, title='', inline='week')
ihWeekly = input.bool(false, title='Open Line', inline='week')

iSelectWeek = input.string(title="Select Week", defval="MON", options=["MON","TUE","WED","THU","FRI","SAT","SUN"])

lineStyle = input.string(title='Vertical Line Style', defval=line.style_dashed, options=[line.style_dotted, line.style_dashed, line.style_solid])
hLineStyle = input.string(title='Horizontal Line Style', defval=line.style_solid, options=[line.style_dotted, line.style_dashed, line.style_solid])
// ]

//////// 
// Preparing
// [
[yearlyTime, yearlyOpen] = request.security(syminfo.tickerid, '12M', [time, open], lookahead=barmerge.lookahead_on)
[monthlyTime, monthlyOpen] = request.security(syminfo.tickerid, 'M', [time, open], lookahead=barmerge.lookahead_on)
[dailyTime, dailyOpen] = request.security(syminfo.tickerid, 'D', [time, open], lookahead=barmerge.lookahead_on)
[weeklyTime, weeklyOpen] = request.security(syminfo.tickerid, 'W', [time, open], lookahead=barmerge.lookahead_on)
// ]

//////// 
// Making
// [
var line hLine_yearly = na
var label hlabel_yearly = na
if iYearly
    var iDrawTimeY_= 0
    yy = year
    mm = month(iBaseTime)
    dd = dayofmonth(iBaseTime)
    hh = hour(iBaseTime)
    m2 = minute(iBaseTime)

    iDrawTime = timestamp(yy, mm, dd, hh, m2)

    // double drawing prevention
    if iDrawTime != iDrawTimeY_ and iDrawTime < timenow
        // Horizontal
        if ihYearly
            line.new(iDrawTimeY_, yearlyOpen, iDrawTime, yearlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hyearlyColor, width=1)
        // Vertical
        line.new(iDrawTime, yearlyOpen, iDrawTime, yearlyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=yearlyColor, width=1)
        iDrawTimeY_ := iDrawTime
    if ihYearly
        line.delete(hLine_yearly)
        label.delete(hlabel_yearly)
        hLine_yearly  := line.new(iDrawTimeY_, yearlyOpen, last_bar_time, yearlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hyearlyColor, width=1)
        hlabel_yearly := label.new(last_bar_index+50, yearlyOpen, "Yearly Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hyearlyColor, size=size.normal)

var line hLine_monthly = na
var label hlabel_monthly = na
if iMonthly
    var iDrawTimeM_= 0
    yy = year
    mm = month
    dd = dayofmonth(iBaseTime)
    hh = hour(iBaseTime)
    m2 = minute(iBaseTime)

    iDrawTime = timestamp(yy, mm, dd, hh, m2)

    // double drawing prevention
    if iDrawTime != iDrawTimeM_ and iDrawTime < timenow
        // Horizontal
        if ihMonthly
            line.new(iDrawTimeM_, monthlyOpen, iDrawTime, monthlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hmonthlyColor, width=1)
        // Vertical
        line.new(iDrawTime, monthlyOpen, iDrawTime, monthlyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=monthlyColor, width=1)
        iDrawTimeM_ := iDrawTime
    if ihMonthly
        line.delete(hLine_monthly)
        label.delete(hlabel_monthly)
        hLine_monthly  := line.new(iDrawTimeM_, monthlyOpen, last_bar_time, monthlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hmonthlyColor, width=1)
        hlabel_monthly := label.new(last_bar_index+50, monthlyOpen, "Monthly Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hmonthlyColor, size=size.normal)

var line hLine_daily = na
var label hlabel_daily = na
// flag for plotshape()
iDspWeekOnDaily=false
if iDaily
    // H4を超える時間足は出力しない
    if timeframe.in_seconds(timeframe.period) <= 14400
        var iDrawTimeD_= 0
        var iOpenD_ = 0.0
        yy = year
        mm = month
        dd = dayofmonth
        hh = hour(iBaseTime)
        m2 = minute(iBaseTime)

        iDrawTime = timestamp(yy, mm, dd, hh, m2)

        hour_j = hour(iDrawTime, "GMT+9")
        dayofweek_j = dayofweek(iDrawTime, "GMT+9")

        iDsp = true
        if dayofweek_j == dayofweek.saturday and hour_j >= 6
            iDsp := false
        else if dayofweek_j == dayofweek.sunday
            iDsp := false
        else if dayofweek_j == dayofweek.monday and hour_j < 7
            iDsp := false

        if syminfo.type == "crypto"
            iDsp := true

        // double drawing prevention
        if iDrawTime != iDrawTimeD_ and iDsp and iDrawTime < timenow 
            // Horizontal
            if ihDaily
                line.new(iDrawTimeD_, iOpenD_, iDrawTime, iOpenD_, xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hdailyColor, width=1)
            // Vertical
            line.new(iDrawTime, dailyOpen, iDrawTime, dailyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=dailyColor, width=1)
            iDspWeekOnDaily:=true
            iDrawTimeD_ := iDrawTime
            iOpenD_     := dailyOpen
        if ihDaily
            line.delete(hLine_daily)
            label.delete(hlabel_daily)
            hLine_daily  := line.new(iDrawTimeD_, dailyOpen, last_bar_time, dailyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hdailyColor, width=1)
            hlabel_daily := label.new(last_bar_index+50, dailyOpen, "Daily Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hdailyColor, size=size.normal)

// Draw a vertical line to display the day of the week below the chart
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.monday,    offset=0, style=shape.diamond, text="MON" , color=color.lime  , location = location.bottom, textcolor=color.lime  )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.tuesday,   offset=0, style=shape.diamond, text="TUE" , color=color.red   , location = location.bottom, textcolor=color.red   )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.wednesday, offset=0, style=shape.diamond, text="WED" , color=color.aqua  , location = location.bottom, textcolor=color.aqua  )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.thursday,  offset=0, style=shape.diamond, text="THU" , color=color.yellow, location = location.bottom, textcolor=color.yellow)
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.friday,    offset=0, style=shape.diamond, text="FRI" , color=color.orange, location = location.bottom, textcolor=color.orange)
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.saturday,  offset=0, style=shape.diamond, text="SAT" , color=color.gray  , location = location.bottom, textcolor=color.gray  )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.sunday,    offset=0, style=shape.diamond, text="SUN" , color=color.gray  , location = location.bottom, textcolor=color.gray  )

var line hLine_weekly = na
var label hlabel_weekly = na
if iWeekly
    // Convert day of week to number
    iDayofweek=iSelectWeek=="SUN"?0:iSelectWeek=="MON"?1:iSelectWeek=="TUE"?2:iSelectWeek=="WED"?3:iSelectWeek=="THU"?4:iSelectWeek=="FRI"?5:iSelectWeek=="SAT"?6:1

    // Selected day of week?
    if dayofweek==iDayofweek and ta.change(dayofweek)
        var iDrawTimeW_ = 0
        yy = year
        mm = month
        dd = dayofmonth
        hh = hour(iBaseTime)
        m2 = minute(iBaseTime)

        iDrawTime = timestamp(yy, mm, dd, hh, m2)

        if iDrawTime != iDrawTimeW_ and iDrawTime < timenow 
            // Horizontal
            if ihWeekly
                line.new(iDrawTimeW_, weeklyOpen[1], iDrawTime, weeklyOpen[1], xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hweeklyColor, width=1)
            // Vertical
            line.new(iDrawTime, weeklyOpen, iDrawTime, weeklyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=weeklyColor, width=1)
            iDrawTimeW_ := iDrawTime
        if ihWeekly
            line.delete(hLine_weekly)
            label.delete(hlabel_weekly)
            // hLine_weekly  := line.new(iDrawTimeW_, weeklyOpen, last_bar_time, weeklyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hweeklyColor, width=1)
            if ta.change(weekofyear)
                hLine_weekly := line.new(na, na, na, na, style=hLineStyle, extend=extend.right, color=hweeklyColor, width=1)
                line.set_xy1(hLine_weekly, bar_index[1], open)
                line.set_xy2(hLine_weekly, bar_index,    open)
            hlabel_weekly := label.new(last_bar_index+50, weeklyOpen, "Weekly Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hweeklyColor, size=size.normal)
// ]



Thanks 😊🙏🏽

Dear Mr Tools,
I am still asking if you have free time...please help me with this indicator !

post1295556442.html#p1295556442

Re: Already Converted TradingView Indicators to MT4 Indicators

515
Lwqa wrote: Thu Dec 19, 2024 8:05 pm Hello Mr Tools and Kvak !
Please convert this indicator to Mt4 !
https://www.tradingview.com/script/t0NM4QnZ/

Reason: It is a good tool to mark a specific date in each month. Let's take example in the case of NFP, we can put the date of Friday of the 1st month.
And also to schedule upcoming events.

Moreover, there was no indicator like this in MT4.

Code: Select all

//@version=5

////////
// Title 
indicator(title='Vertical & Open Lines - Yearly Monthly Weekly Daily [MsF]', shorttitle='YMWD V&O Lines', overlay=true, max_lines_count=500, max_labels_count=500)

////////
// Input values 
// [
iBaseTime = input.time(defval=timestamp('01 Jan 2018 0:00 +0000'), title='Base Time')

yearlyColor = input.color(defval=color.red, title='', inline='year')
iYearly = input.bool(true, title='Show Yearly', inline='year')
hyearlyColor = input.color(defval=color.red, title='', inline='year')
ihYearly = input.bool(false, title='Open Line', inline='year')

monthlyColor = input.color(defval=color.orange, title='', inline='month')
iMonthly = input.bool(true, title='Show Monthly', inline='month')
hmonthlyColor = input.color(defval=color.orange, title='', inline='month')
ihMonthly = input.bool(false, title='Open Line', inline='month')

dailyColor = input.color(defval=color.yellow, title='', inline='day')
iDaily = input.bool(false, title='Show Daily', inline='day')
hdailyColor = input.color(defval=color.yellow, title='', inline='day')
ihDaily = input.bool(false, title='Open Line', inline='day')

weeklyColor = input.color(defval=color.lime, title='', inline='week')
iWeekly = input.bool(false, title='Show Weekly', inline='week')
hweeklyColor = input.color(defval=color.lime, title='', inline='week')
ihWeekly = input.bool(false, title='Open Line', inline='week')

iSelectWeek = input.string(title="Select Week", defval="MON", options=["MON","TUE","WED","THU","FRI","SAT","SUN"])

lineStyle = input.string(title='Vertical Line Style', defval=line.style_dashed, options=[line.style_dotted, line.style_dashed, line.style_solid])
hLineStyle = input.string(title='Horizontal Line Style', defval=line.style_solid, options=[line.style_dotted, line.style_dashed, line.style_solid])
// ]

//////// 
// Preparing
// [
[yearlyTime, yearlyOpen] = request.security(syminfo.tickerid, '12M', [time, open], lookahead=barmerge.lookahead_on)
[monthlyTime, monthlyOpen] = request.security(syminfo.tickerid, 'M', [time, open], lookahead=barmerge.lookahead_on)
[dailyTime, dailyOpen] = request.security(syminfo.tickerid, 'D', [time, open], lookahead=barmerge.lookahead_on)
[weeklyTime, weeklyOpen] = request.security(syminfo.tickerid, 'W', [time, open], lookahead=barmerge.lookahead_on)
// ]

//////// 
// Making
// [
var line hLine_yearly = na
var label hlabel_yearly = na
if iYearly
    var iDrawTimeY_= 0
    yy = year
    mm = month(iBaseTime)
    dd = dayofmonth(iBaseTime)
    hh = hour(iBaseTime)
    m2 = minute(iBaseTime)

    iDrawTime = timestamp(yy, mm, dd, hh, m2)

    // double drawing prevention
    if iDrawTime != iDrawTimeY_ and iDrawTime < timenow
        // Horizontal
        if ihYearly
            line.new(iDrawTimeY_, yearlyOpen, iDrawTime, yearlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hyearlyColor, width=1)
        // Vertical
        line.new(iDrawTime, yearlyOpen, iDrawTime, yearlyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=yearlyColor, width=1)
        iDrawTimeY_ := iDrawTime
    if ihYearly
        line.delete(hLine_yearly)
        label.delete(hlabel_yearly)
        hLine_yearly  := line.new(iDrawTimeY_, yearlyOpen, last_bar_time, yearlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hyearlyColor, width=1)
        hlabel_yearly := label.new(last_bar_index+50, yearlyOpen, "Yearly Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hyearlyColor, size=size.normal)

var line hLine_monthly = na
var label hlabel_monthly = na
if iMonthly
    var iDrawTimeM_= 0
    yy = year
    mm = month
    dd = dayofmonth(iBaseTime)
    hh = hour(iBaseTime)
    m2 = minute(iBaseTime)

    iDrawTime = timestamp(yy, mm, dd, hh, m2)

    // double drawing prevention
    if iDrawTime != iDrawTimeM_ and iDrawTime < timenow
        // Horizontal
        if ihMonthly
            line.new(iDrawTimeM_, monthlyOpen, iDrawTime, monthlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hmonthlyColor, width=1)
        // Vertical
        line.new(iDrawTime, monthlyOpen, iDrawTime, monthlyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=monthlyColor, width=1)
        iDrawTimeM_ := iDrawTime
    if ihMonthly
        line.delete(hLine_monthly)
        label.delete(hlabel_monthly)
        hLine_monthly  := line.new(iDrawTimeM_, monthlyOpen, last_bar_time, monthlyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hmonthlyColor, width=1)
        hlabel_monthly := label.new(last_bar_index+50, monthlyOpen, "Monthly Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hmonthlyColor, size=size.normal)

var line hLine_daily = na
var label hlabel_daily = na
// flag for plotshape()
iDspWeekOnDaily=false
if iDaily
    // H4を超える時間足は出力しない
    if timeframe.in_seconds(timeframe.period) <= 14400
        var iDrawTimeD_= 0
        var iOpenD_ = 0.0
        yy = year
        mm = month
        dd = dayofmonth
        hh = hour(iBaseTime)
        m2 = minute(iBaseTime)

        iDrawTime = timestamp(yy, mm, dd, hh, m2)

        hour_j = hour(iDrawTime, "GMT+9")
        dayofweek_j = dayofweek(iDrawTime, "GMT+9")

        iDsp = true
        if dayofweek_j == dayofweek.saturday and hour_j >= 6
            iDsp := false
        else if dayofweek_j == dayofweek.sunday
            iDsp := false
        else if dayofweek_j == dayofweek.monday and hour_j < 7
            iDsp := false

        if syminfo.type == "crypto"
            iDsp := true

        // double drawing prevention
        if iDrawTime != iDrawTimeD_ and iDsp and iDrawTime < timenow 
            // Horizontal
            if ihDaily
                line.new(iDrawTimeD_, iOpenD_, iDrawTime, iOpenD_, xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hdailyColor, width=1)
            // Vertical
            line.new(iDrawTime, dailyOpen, iDrawTime, dailyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=dailyColor, width=1)
            iDspWeekOnDaily:=true
            iDrawTimeD_ := iDrawTime
            iOpenD_     := dailyOpen
        if ihDaily
            line.delete(hLine_daily)
            label.delete(hlabel_daily)
            hLine_daily  := line.new(iDrawTimeD_, dailyOpen, last_bar_time, dailyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hdailyColor, width=1)
            hlabel_daily := label.new(last_bar_index+50, dailyOpen, "Daily Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hdailyColor, size=size.normal)

// Draw a vertical line to display the day of the week below the chart
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.monday,    offset=0, style=shape.diamond, text="MON" , color=color.lime  , location = location.bottom, textcolor=color.lime  )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.tuesday,   offset=0, style=shape.diamond, text="TUE" , color=color.red   , location = location.bottom, textcolor=color.red   )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.wednesday, offset=0, style=shape.diamond, text="WED" , color=color.aqua  , location = location.bottom, textcolor=color.aqua  )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.thursday,  offset=0, style=shape.diamond, text="THU" , color=color.yellow, location = location.bottom, textcolor=color.yellow)
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.friday,    offset=0, style=shape.diamond, text="FRI" , color=color.orange, location = location.bottom, textcolor=color.orange)
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.saturday,  offset=0, style=shape.diamond, text="SAT" , color=color.gray  , location = location.bottom, textcolor=color.gray  )
plotshape(iDspWeekOnDaily and dayofweek==dayofweek.sunday,    offset=0, style=shape.diamond, text="SUN" , color=color.gray  , location = location.bottom, textcolor=color.gray  )

var line hLine_weekly = na
var label hlabel_weekly = na
if iWeekly
    // Convert day of week to number
    iDayofweek=iSelectWeek=="SUN"?0:iSelectWeek=="MON"?1:iSelectWeek=="TUE"?2:iSelectWeek=="WED"?3:iSelectWeek=="THU"?4:iSelectWeek=="FRI"?5:iSelectWeek=="SAT"?6:1

    // Selected day of week?
    if dayofweek==iDayofweek and ta.change(dayofweek)
        var iDrawTimeW_ = 0
        yy = year
        mm = month
        dd = dayofmonth
        hh = hour(iBaseTime)
        m2 = minute(iBaseTime)

        iDrawTime = timestamp(yy, mm, dd, hh, m2)

        if iDrawTime != iDrawTimeW_ and iDrawTime < timenow 
            // Horizontal
            if ihWeekly
                line.new(iDrawTimeW_, weeklyOpen[1], iDrawTime, weeklyOpen[1], xloc=xloc.bar_time, style=hLineStyle, extend=extend.none, color=hweeklyColor, width=1)
            // Vertical
            line.new(iDrawTime, weeklyOpen, iDrawTime, weeklyOpen + syminfo.mintick, xloc=xloc.bar_time, style=lineStyle, extend=extend.both, color=weeklyColor, width=1)
            iDrawTimeW_ := iDrawTime
        if ihWeekly
            line.delete(hLine_weekly)
            label.delete(hlabel_weekly)
            // hLine_weekly  := line.new(iDrawTimeW_, weeklyOpen, last_bar_time, weeklyOpen, xloc=xloc.bar_time, style=hLineStyle, extend=extend.right, color=hweeklyColor, width=1)
            if ta.change(weekofyear)
                hLine_weekly := line.new(na, na, na, na, style=hLineStyle, extend=extend.right, color=hweeklyColor, width=1)
                line.set_xy1(hLine_weekly, bar_index[1], open)
                line.set_xy2(hLine_weekly, bar_index,    open)
            hlabel_weekly := label.new(last_bar_index+50, weeklyOpen, "Weekly Open", xloc=xloc.bar_index, color=color.rgb(255,255,255,100), style=label.style_label_down, textcolor=hweeklyColor, size=size.normal)
// ]



Thanks 😊🙏🏽
Hello, have no idea how to do that, sorry!


Re: Already Converted TradingView Indicators to MT4 Indicators

516
kvak wrote: Thu Dec 19, 2024 8:37 am Hello, I made this simple version, for now without T3.
But after your test, I am able do some adjustment, but test it first please....
hello i requested a indicator a little while ago_____the BXTrender
there was one provided i have been testing -thank you
i got another copy and wanted to post it here for any one interested in the indicator.
its a simple basic variation - it can be modified if need be i have included two other variations for reference
i have been experimenting with signal alignments for signal confirmation.
the long version is the long rsi/ema with transition dots and thresholds
the short version is the short rsi/ema with transition dots on the threshold lines they can be adjusted based off the zero line crosses the thresholds can speed the cross up a couple bars if needed ( a couple of my variations, they are far from perfect-good enough for my uses included here for reference for any one that is interested)
thanks for the original indicator .
These users thanked the author nine for the post (total 2):
vinuthbn84, specialkey

Re: Already Converted TradingView Indicators to MT4 Indicators

517
Boom Hunter Pro

while i was at it i came across this indicator looks interesting.
seen some mentions of this for TV.
I am getting familiar with it, its kind of busy i have been watching youtube videos unsure about how to read it and all the signals
here are the files for a Boom Hunter Pro conversion seems fairly accurate. i have yet to give an indepth look at it. i initially thought i may be able to use it for signal alignment or a confirmation window for signal filtering. i have yet to figure it out. haven't had time to spend messing with it yet.

here is the link:
https://www.tradingview.com/script/coMN ... unter-Pro/

i am going to figure it out when i have time and look through the code in more depth.
i wanted to post it here before i forgot. and for anyone interested so they had access to it.
happy trading and good luck
These users thanked the author nine for the post (total 2):
global, specialkey

Re: Already Converted TradingView Indicators to MT4 Indicators

518
nine wrote: Wed Jan 01, 2025 4:14 am Boom Hunter Pro

while i was at it i came across this indicator looks interesting.
seen some mentions of this for TV.
I am getting familiar with it, its kind of busy i have been watching youtube videos unsure about how to read it and all the signals
here are the files for a Boom Hunter Pro conversion seems fairly accurate. i have yet to give an indepth look at it. i initially thought i may be able to use it for signal alignment or a confirmation window for signal filtering. i have yet to figure it out. haven't had time to spend messing with it yet.

here is the link:
https://www.tradingview.com/script/coMN ... unter-Pro/

i am going to figure it out when i have time and look through the code in more depth.
i wanted to post it here before i forgot. and for anyone interested so they had access to it.
happy trading and good luck
I have been very close with the creator of this, he was a wonderful person, sadly passed away.
Thanks for this, I will take a look at the code as I have more advanced versions of this.
These users thanked the author Cagliostro for the post (total 4):
nine, ssotiro, RodrigoRT7, specialkey
"I conjure from shadows and shape fortunes from the unseen. The treasure lies hidden in plain sight, beneath the sunlight." - Cagliostro