Created
May 1, 2018 19:09
-
-
Save libasoles/2df80a435f9926975ecbb358d42a9b84 to your computer and use it in GitHub Desktop.
Mostrando valores limit en cryptomkt
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
(()=>{ | |
function init() { | |
createLimitsViewer(); | |
} | |
function update() { | |
const {stopLoss, takeProfit} = config.limits[base_name]; | |
$('#stop-loss-viewer').text('$'+stopLoss); | |
$('#take-profit-viewer').text('$'+takeProfit); | |
} | |
/** config */ | |
const config = { | |
limits: { | |
'XLM': { | |
stopLoss: 9.34, | |
takeProfit: 11.5 | |
} | |
} | |
} | |
/** helpers */ | |
function createLimitsViewer() { | |
// haciendo uso de la variable global base_name, muestro el stop loss | |
$(`<li> | |
<div id="header-limits" class="content-text text-center" style="margin-top: 10px;"> | |
<div style="top: 0px;" class="header_price_container"> | |
<div class="price_container container_bid animation"> | |
<div class="margin-top-neg-4">stop loss</div> | |
<div class="margin-top-neg"><b id="stop-loss-viewer">-</b></div> | |
</div> | |
<div class="price_container margin-left-10 container_ask animation"> | |
<div class="margin-top-neg-4">take profit</div> | |
<div class="margin-top-neg"><b id="take-profit-viewer">-</b></div> | |
</div> | |
</div> | |
</div> | |
</li> | |
`).insertBefore('#alerts_dropdown'); | |
$('<li><span class="divider_nav"> </span></li>').insertBefore('#alerts_dropdown'); | |
} | |
init(); | |
setInterval(update, 1000); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment