Code: Select all
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © WelcomeToMathy
//@version=4
study("Nw's Quarter Theory", overlay=true)
//=================================================================================================================================== INPUT
Size=input(25,title="Level Size (in pips)", type=input.integer)
//=================================================================================================================================== LIBRARY
//version 2 with color
QuarterLine(Pips,lvl,col)=>
StartLevel = lvl
lastPrice = syminfo.mintick*100000
return = (((round(open*(100/lastPrice)/(Pips/100))+lvl)/((100/lastPrice)/(Pips/100))))
//return //if you want to use plots
line.new(x1 = bar_index[1], y1 = return, x2 = bar_index, y2 = return, extend = extend.both, color = col, style = line.style_arrow_left, width = 2) //if you want to print imediatly
//=================================================================================================================================== PLOTS
QuarterLine(Size,2,color.yellow)
QuarterLine(Size,1,color.yellow)
QuarterLine(Size,0,color.yellow)
QuarterLine(Size,-1,color.yellow)
QuarterLine(Size,-2,color.yellow)