AkifTokuz

Midas S/R Line

246 1 26
Updated: Use the updated version here :https://www.tradingview.com/v/UiJRZmpL/
Entering precise date and time is cumbersome. New version is much cleaner and simpler. Use Midas-Bar Number indicator to see the bar number.

Plots MIDAS S/R Line on daily and intraday charts using different price values. MIDAS Support Lines can be created using Low values as priceType and MIDAS Resistance Lines can be created using High values.Hour and minute input is not used on daily and higher Tf charts.
Remove from Favorite Scripts Add to Favorite Scripts
// Akif TOKUZ
// akifusenet@gmail.com
// MIDAS S/R  lines
study("Midas", overlay=true)

sy=input(title="starting year",minval=1980,maxval=2100,defval=2014)
sm=input(title="starting month",minval=1,maxval=12,defval=9)
sd=input(title="starting day of month",minval=1,maxval=31,defval=2)
shour=input(title="starting hour",minval=0,maxval=23,defval=10)
smin=input(title="starting hour",minval=0,maxval=59,defval=0)

priceType=input(title="calculate using 1:hl2 2:high 3:low 4:hlc3",minval=1,maxval=4,defval=1)




start1=iff( year == sy and month == sm and dayofmonth == sd,1,0)
start2=iff( year == sy and month == sm and dayofmonth == sd and hour==shour and minute==smin,1,0)
start = iff (isdwm,start1,start2)

p = iff (priceType==1,hl2,
            iff(priceType==2,high,
                iff(priceType==3,low,hlc3)
            )
        )


v = na(volume) ? 1 : volume

cumV = cum(v)
CumPV = cum(p*v)

startV = valuewhen(start,cumV,0)
StartPV = valuewhen(start,CumPV,0)

midas = (CumPV-StartPV)/(cumV-startV)


plot(midas, color=navy,linewidth=2)

United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out