Page 1 of 1

Quarter Theory Function to print Lines

Posted: Sun Apr 18, 2021 3:49 pm
by K4eMi
Passing buy to share this little code I use to plot quarter lines for who enjoys the trading style :cool:

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)