Last active
December 18, 2017 15:16
-
-
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.
This file contains 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
//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