This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=3 | |
study("Pump Catcher") | |
length = input(title="Lookback Period (in candles)", type=integer, defval=20) | |
abnormalVolumeThreshold = input(title="Abnormal Volume threshold (1-99)", type=integer, defval=50, minval = 1, maxval = 99) | |
mav = sma(volume, length) // Average volume of the last 20 candles. | |
difference = mav - mav[1] // Difference between the last candles volume and this one. | |
volumeIncreasing = difference > 0 // Is the volume increasing? | |
valueIncreasing = close > close[1] // Is the value increasing? | |
increasing = valueIncreasing and volumeIncreasing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Timer = (function Timer() { | |
var vars = { | |
startTime: 0, | |
stopTime: 0, | |
time: 0, | |
reset: function() { | |
vars.startTime = 0; | |
vars.stopTime = 0; | |
vars.time = 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadScript(url, callback) { | |
var script = document.createElement("script") | |
script.type = "text/javascript"; | |
if (script.readyState) { //IE | |
script.onreadystatechange = function () { | |
if (script.readyState == "loaded" || script.readyState == "complete") { | |
script.onreadystatechange = null; | |
callback(); | |
} | |
}; |