NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Based on script from © ProfessorZoom revised by Agar1999

//@version=4

study("Voodoo Levels", overlay=true, max_bars_back=4000)

// Inputs
var barsBack = input(title="Bars to Check For", type=input.integer, defval=365, group="Main Settings", minval=20, maxval=4000, step=1)
var extendUnFilled = input(title="Extend Unfilled Gap Boxes", type=input.bool, defval=true, group="Main Settings")
var extendFilled = input(title="Extend Filled Gap Boxes", type=input.bool, defval=true, group="Main Settings")
var showFilledBoxes = input(title="Show Filled Gap Boxes", type=input.bool, defval=true, group="Main Settings")
var gapFilledLabelColor = input(title="Gap Filled Label Color", type=input.color, defval=color.white, group="Main Settings")
var hideAllFilledStuff = input(title="Hide All Filled Gap Stuff", type=input.bool, defval=false, group="Main Settings")
var showLabels = input(title="Show Gap Notification Labels", type=input.bool, defval=false, group="Main Settings")

var DistFromGap = input(title="Max Percentage Distance Between Gap and Current Price", type=input.integer, defval=5, minval=0, group="Gap Requirements") //Script will not show voodoo lines far from current price as they are unnecessary
var MinGapSize = input(title="Require Minimum Gap Size", type=input.bool, defval=true, group="Gap Requirements")
var GapSize = input(title="Only Show Gaps Greater Than A Certain Percentage", type=input.integer, defval=3, minval=0, group="Gap Requirements")

var gapUpLabelColor = input(title="Gap Up Label Color", type=input.color, defval=color.white, group="Gap Up")
var gapUpBorderColor = input(title="Gap Up Border Color", type=input.color, defval=color.orange, group="Gap Up")

var gapDownLabelColor = input(title="Gap Down Label Color", type=input.color, defval=color.white, group="Gap Down")
var gapDownBorderColor = input(title="Gap Down Border Color", type=input.color, defval=color.white, group="Gap Down")


// Gap Ups
var gapUpBarsAgo = array.new_int()
var gapUpRight = array.new_int()
var gapUpLeft = array.new_int()
var gapUpHighs = array.new_float()
var gapUpLows = array.new_float()
var gapUpClosed = array.new_int()

// Gap Downs
var gapDownBarsAgo = array.new_int()
var gapDownRight = array.new_int()
var gapDownLeft = array.new_int()
var gapDownHighs = array.new_float()
var gapDownLows = array.new_float()
var gapDownClosed = array.new_int()

// Will use the most recent price at open of 1 minute candle
t = tickerid(syminfo.prefix, syminfo.ticker)
realC = security(t, "5", open)


// Index begins with current day and moves backwards; Higher index value means further in the past
if timeframe.isdaily == true
if barstate.islast

// Check for gaps
for i = 0 to barsBack

// Gap Ups
if low[i] > high[i+1]
if showLabels
label.new(bar_index[i], high[i], "Gap Up", color=gapUpLabelColor)
array.push(gapUpBarsAgo, i)
array.push(gapUpRight, bar_index[i])
array.push(gapUpLeft, bar_index[i+1])
array.push(gapUpHighs, low[i])
array.push(gapUpLows, high[i+1])

// Gap Downs
if high[i] < low[i+1]
if showLabels
label.new(bar_index[i], high[i], "Gap Down", color=gapDownLabelColor)
array.push(gapDownBarsAgo, i)
array.push(gapDownRight, bar_index[i])
array.push(gapDownLeft, bar_index[i+1])
array.push(gapDownHighs, low[i+1])
array.push(gapDownLows, high[i])

// [GAP UP] Check if any gaps are filled
if (array.size(gapUpBarsAgo) > 0)
for i = 0 to array.size(gapUpRight) - 1
for j = array.get(gapUpBarsAgo, i) to 0
if low[j] <= array.get(gapUpLows, i)
if showFilledBoxes and hideAllFilledStuff == false
if ((abs(realC - array.get(gapUpHighs, i))/realC)<=(DistFromGap/100)) or ((abs(realC - array.get(gapUpLows, i))/realC)<=(DistFromGap/100))//if the gap is within 10 percent of open price, plot lines
if (MinGapSize == true)
if (((((low[i] - high[i+1])/low[i])*100)>=GapSize) or ((((high[i] - low[i+1])/high[i])*100)>=GapSize))
// box.new(left=array.get(gapUpLeft, i), top=array.get(gapUpHighs, i), right=bar_index[j], bottom=array.get(gapUpLows, i), border_width=1, border_style=line.style_solid, bgcolor=gapUpBackgroundColor, border_color=gapUpBorderColor, extend=extendFilled ? extend.right : extend.none)
line.new(x1=array.get(gapUpRight, i), y1=array.get(gapUpHighs, i), x2=bar_index[j], y2=array.get(gapUpHighs, i), color=gapUpBorderColor, extend=extend.right, width=1, style=line.style_dashed)
line.new(x1=array.get(gapUpLeft, i), y1=array.get(gapUpLows, i), x2=bar_index[j], y2=array.get(gapUpLows, i), color=gapUpBorderColor, extend=extend.right, width=1, style=line.style_dashed)
if (MinGapSize == false)
// box.new(left=array.get(gapUpLeft, i), top=array.get(gapUpHighs, i), right=bar_index[j], bottom=array.get(gapUpLows, i), border_width=1, border_style=line.style_solid, bgcolor=gapUpBackgroundColor, border_color=gapUpBorderColor, extend=extendFilled ? extend.right : extend.none)
line.new(x1=array.get(gapUpRight, i), y1=array.get(gapUpHighs, i), x2=bar_index[j], y2=array.get(gapUpHighs, i), color=gapUpBorderColor, extend=extend.right, width=1, style=line.style_dashed)
line.new(x1=array.get(gapUpLeft, i), y1=array.get(gapUpLows, i), x2=bar_index[j], y2=array.get(gapUpLows, i), color=gapUpBorderColor, extend=extend.right, width=1, style=line.style_dashed)
if hideAllFilledStuff == false and showLabels
label.new(bar_index[j], low[j], "Gap Filled", color=gapFilledLabelColor, style=label.style_label_up)
array.push(gapUpClosed, array.get(gapUpRight, i))
break

// [GAP UP] Draw unfilled gap boxes
for i = 0 to array.size(gapUpRight) - 1
if array.includes(gapUpClosed, array.get(gapUpRight, i)) == false
if ((abs(realC - array.get(gapUpHighs, i))/realC)<=(DistFromGap/100)) or ((abs(realC - array.get(gapUpLows, i))/realC)<=(DistFromGap/100))//if the gap is within 10 percent of open price, plot lines
if (MinGapSize == true)
if (((((low[i] - high[i+1])/low[i])*100)>=GapSize) or ((((high[i] - low[i+1])/high[i])*100)>=GapSize))
//box.new(left=array.get(gapUpLeft, i), top=array.get(gapUpHighs, i), right=bar_index, bottom=array.get(gapUpLows, i), border_width=1, border_style=line.style_solid, bgcolor=gapUpBackgroundColor, border_color=gapUpBorderColor, extend=extendUnFilled ? extend.right : extend.none)
line.new(x1=array.get(gapUpRight, i), y1=array.get(gapUpHighs, i), x2=bar_index, y2=array.get(gapUpHighs, i), color=gapUpBorderColor, extend=extend.right, width=1, style=line.style_dashed)
line.new(x1=array.get(gapUpLeft, i), y1=array.get(gapUpLows, i), x2=bar_index, y2=array.get(gapUpLows, i), color=gapUpBorderColor, extend=extend.right, width=1, style=line.style_dashed)
if (MinGapSize == false)
//box.new(left=array.get(gapUpLeft, i), top=array.get(gapUpHighs, i), right=bar_index, bottom=array.get(gapUpLows, i), border_width=1, border_style=line.style_solid, bgcolor=gapUpBackgroundColor, border_color=gapUpBorderColor, extend=extendUnFilled ? extend.right : extend.none)
line.new(x1=array.get(gapUpRight, i), y1=array.get(gapUpHighs, i), x2=bar_index, y2=array.get(gapUpHighs, i), color=gapUpBorderColor, extend=extend.right, width=1, style=line.style_dashed)
line.new(x1=array.get(gapUpLeft, i), y1=array.get(gapUpLows, i), x2=bar_index, y2=array.get(gapUpLows, i), color=gapUpBorderColor, extend=extend.right, width=1, style=line.style_dashed)

// [GAP DOWN] Check if any gaps are filled
if (array.size(gapDownBarsAgo) > 0)
for i = 0 to array.size(gapDownRight) - 1
for j = array.get(gapDownBarsAgo, i) to 0
if high[j] >= array.get(gapDownHighs, i)
if showFilledBoxes and hideAllFilledStuff == false
if ((abs(realC - array.get(gapDownHighs, i))/realC)<=(DistFromGap/100)) or ((abs(realC - array.get(gapDownLows, i))/realC)<=(DistFromGap/100))//if the gap is within 10 percent of open price, plot lines
if (MinGapSize == true)
if (((((low[i] - high[i+1])/low[i])*100)>=GapSize) or ((((high[i] - low[i+1])/high[i])*100)>=GapSize))
//box.new(left=array.get(gapDownLeft, i), top=array.get(gapDownHighs, i), right=bar_index[j], bottom=array.get(gapDownLows, i), border_width=1, border_style=line.style_solid, bgcolor=gapDownBackgroundColor, border_color=gapDownBorderColor, extend=extendFilled ? extend.right : extend.none)
line.new(x1=array.get(gapDownLeft, i), y1=array.get(gapDownHighs, i), x2=bar_index[j], y2=array.get(gapDownHighs, i), color=gapDownBorderColor, extend=extend.right, width=1, style=line.style_dashed)
line.new(x1=array.get(gapDownRight, i), y1=array.get(gapDownLows, i), x2=bar_index[j], y2=array.get(gapDownLows, i), color=gapDownBorderColor, extend=extend.right, width=1, style=line.style_dashed)
if (MinGapSize == false)
//box.new(left=array.get(gapDownLeft, i), top=array.get(gapDownHighs, i), right=bar_index[j], bottom=array.get(gapDownLows, i), border_width=1, border_style=line.style_solid, bgcolor=gapDownBackgroundColor, border_color=gapDownBorderColor, extend=extendFilled ? extend.right : extend.none)
line.new(x1=array.get(gapDownLeft, i), y1=array.get(gapDownHighs, i), x2=bar_index[j], y2=array.get(gapDownHighs, i), color=gapDownBorderColor, extend=extend.right, width=1, style=line.style_dashed)
line.new(x1=array.get(gapDownRight, i), y1=array.get(gapDownLows, i), x2=bar_index[j], y2=array.get(gapDownLows, i), color=gapDownBorderColor, extend=extend.right, width=1, style=line.style_dashed)
if hideAllFilledStuff == false and showLabels
label.new(bar_index[j], high[j], "Gap Filled", color=gapFilledLabelColor, style=label.style_label_down)
array.push(gapDownClosed, array.get(gapDownRight, i))
break

// [GAP DOWN] Draw unfilled gap boxes
for i = 0 to array.size(gapDownRight) - 1
if array.includes(gapDownClosed, array.get(gapDownRight, i)) == false
if ((abs(realC - array.get(gapDownHighs, i))/realC)<=(DistFromGap/100)) or ((abs(realC - array.get(gapDownLows, i))/realC)<=(DistFromGap/100))//if the gap is within 10 percent of open price, plot lines
if (MinGapSize == true)
if (((((low[i] - high[i+1])/low[i])*100)>=GapSize) or ((((high[i] - low[i+1])/high[i])*100)>=GapSize))
//box.new(left=array.get(gapDownLeft, i), top=array.get(gapDownHighs, i), right=bar_index, bottom=array.get(gapDownLows, i), border_width=1, border_style=line.style_solid, bgcolor=gapDownBackgroundColor, border_color=gapDownBorderColor, extend=extendUnFilled ? extend.right : extend.none)
line.new(x1=array.get(gapDownLeft, i), y1=array.get(gapDownHighs, i), x2=bar_index, y2=array.get(gapDownHighs, i), color=gapDownBorderColor, extend=extend.right, width=1, style=line.style_dashed)
line.new(x1=array.get(gapDownRight, i), y1=array.get(gapDownLows, i), x2=bar_index, y2=array.get(gapDownLows, i), color=gapDownBorderColor, extend=extend.right, width=1, style=line.style_dashed)
if (MinGapSize == false)
//box.new(left=array.get(gapDownLeft, i), top=array.get(gapDownHighs, i), right=bar_index, bottom=array.get(gapDownLows, i), border_width=1, border_style=line.style_solid, bgcolor=gapDownBackgroundColor, border_color=gapDownBorderColor, extend=extendUnFilled ? extend.right : extend.none)
line.new(x1=array.get(gapDownLeft, i), y1=array.get(gapDownHighs, i), x2=bar_index, y2=array.get(gapDownHighs, i), color=gapDownBorderColor, extend=extend.right, width=1, style=line.style_dashed)
line.new(x1=array.get(gapDownRight, i), y1=array.get(gapDownLows, i), x2=bar_index, y2=array.get(gapDownLows, i), color=gapDownBorderColor, extend=extend.right, width=1, style=line.style_dashed)
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.