Skip to content

Instantly share code, notes, and snippets.

@adtjha
Last active December 18, 2017 15:16
Show Gist options
  • Save adtjha/a90ad2cbf5bc9b4b8c0c5fbd7f954d16 to your computer and use it in GitHub Desktop.
Save adtjha/a90ad2cbf5bc9b4b8c0c5fbd7f954d16 to your computer and use it in GitHub Desktop.
Created a gist for filtering the most traded stocks according to their price.
//Works only on "http://money.rediff.com/companies/most-traded/nse"
//Used for filtering stocks according to the current price.
var array = document.querySelector('.dataTable').children[1].children.length; //All the stocks displayed on the webpage.
var lowerLimit = 100;
var upperLimit = 200;
for (var i = 0; i < array; i++) {
var currentPrice = parseFloat(document.querySelector('.dataTable').children[1].children[i].children[1].innerText);
//Current Price Of every Stock.
if (currentPrice > lowerLimit && currentPrice < upperLimit) {
document.querySelector('.dataTable').children[1].children[i].style.background = 'black';
document.querySelector('.dataTable').children[1].children[i].style.color = 'white';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment