Skip to content

Instantly share code, notes, and snippets.

@surjithctly
Last active August 19, 2017 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save surjithctly/5c2eb95bad450b95cff4d2ed1536c93b to your computer and use it in GitHub Desktop.
Save surjithctly/5c2eb95bad450b95cff4d2ed1536c93b to your computer and use it in GitHub Desktop.
NSE Open Hour Breakout JS Bookmarklet

Installation

javascript:!function(){function d(){(window.myBookmarklet=function(){console.log("Open Breakout Code Started \n Created by Surjith S M \nhttp://surjithctly.in/"),console.log("scanning"),$("#dataTable tr").each(function(){$("td",this).css("background",""),$("td a",this).css("color","");var a=$("td:nth-child(4)",this).text().replace(/,/g,""),b=$("td:nth-child(5)",this).text().replace(/,/g,""),c=$("td:nth-child(6)",this).text().replace(/,/g,""),d=$("td:nth-child(1)",this).text();a==b&&($("td:nth-child(5), td:nth-child(1)",this).css({color:"white",background:"Red"}),$("td:nth-child(1) a",this).css({color:"white"}),console.log("Go Short Found: "+d)),a==c&&($("td:nth-child(6), td:nth-child(1)",this).css("background","Lime"),console.log("Go Long Found: "+d))}),console.log("finished scanning \nThank you!")})()}var a="1.3.2";if(void 0===window.jQuery||window.jQuery.fn.jquery<a){var b=!1,c=document.createElement("script");c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+a+"/jquery.min.js",c.onload=c.onreadystatechange=function(){b||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(b=!0,d())},document.getElementsByTagName("head")[0].appendChild(c)}else d()}();
  • Copy the JS Code
  • Create a new Bookmark in your Bookmark Bar
  • Give name as "NSE Open Breakout" or any other name as you wish
  • Paste the copied code inside "URL"
  • Make sure it starts with javascript:

Now head over to NSE India Live Market Page and Click on the Bookmark.

Guide

nse-breakout

  • Red color in the High & Symbol says, Go Short.
  • Green color in the Low & Symbol says, Go Long.
(function() {
// the minimum version of jQuery we want
var v = "1.3.2";
// check prior inclusion and version
if (window.jQuery === undefined || window.jQuery.fn.jquery < v) {
var done = false;
var script = document.createElement("script");
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + v +
"/jquery.min.js";
script.onload = script.onreadystatechange = function() {
if (!done && (!this.readyState || this.readyState == "loaded"
||
this.readyState == "complete")) {
done = true;
initMyBookmarklet();
}
};
document.getElementsByTagName("head")[0].appendChild(script);
} else {
initMyBookmarklet();
}
function initMyBookmarklet() {
(window.myBookmarklet = function() {
console.log('Open Breakout Code Started \n Created by Surjith S M \nhttp://surjithctly.in/');
console.log('scanning');
$('#dataTable tr').each(function() {
$('td', this).css('background', '');
$('td a', this).css('color', '');
var s_dayOpen = $('td:nth-child(4)', this).text().replace(/,/g, "");
var s_dayHigh = $('td:nth-child(5)', this).text().replace(/,/g, "");
var s_dayLow = $('td:nth-child(6)', this).text().replace(/,/g, "");
var s_Symbol = $('td:nth-child(1)', this).text();
if (s_dayOpen == s_dayHigh) {
$('td:nth-child(5), td:nth-child(1)', this).css({
'color': 'white',
'background': 'Red'
});
$('td:nth-child(1) a', this).css({
'color': 'white'
});
console.log('Go Short Found: ' + s_Symbol);
}
if (s_dayOpen == s_dayLow) {
$('td:nth-child(6), td:nth-child(1)', this).css('background', 'Lime');
console.log('Go Long Found: ' + s_Symbol);
}
});
console.log('finished scanning \nThank you!');
})();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment