Then replace the string with 1800 for 30min, 900 for 15min and so on...
if (dif>MinThreshold) {
chrome.browserAction.setBadgeBackgroundColor({color:[0, 128, 0, 200]})
if (USD>=0.01) {
if (getemadif(H1.length-2) > MinThreshold) {
console.log("BUY!!!")
mtgoxpost("buyBTC.php", ['Currency=USD','amount=1000'], one, onl)
}
} else {
//console.log("No USD to exec up-trend")
}
} else if (dif<-MinThreshold) {
chrome.browserAction.setBadgeBackgroundColor({color:[128, 0, 0, 200]})
if (BTC>=0.001) {
if (getemadif(H1.length-2) < -MinThreshold) {
console.log("SELL!!!")
mtgoxpost("sellBTC.php", ['Currency=USD','amount=1000'], one, onl)
}
} else {
//console.log("No BTC to exec down-trend")
}
} else {
if (dif>0) {
chrome.browserAction.setBadgeBackgroundColor({color:[10, 100, 10, 100]})
} else {
chrome.browserAction.setBadgeBackgroundColor({color:[100, 10, 10, 100]})
}
}
... with this:
if (dif>MinThreshold) {
chrome.browserAction.setBadgeBackgroundColor({color:[0, 128, 0, 200]})
if (USD>=0.01) {
console.log("BUY!!!")
mtgoxpost("buyBTC.php", ['Currency=USD','amount=1000'], one, onl)
} else {
//console.log("No USD to exec up-trend")
}
} else if (dif<-MinThreshold) {
chrome.browserAction.setBadgeBackgroundColor({color:[128, 0, 0, 200]})
if (BTC>=0.001) {
console.log("SELL!!!")
mtgoxpost("sellBTC.php", ['Currency=USD','amount=1000'], one, onl)
} else {
//console.log("No BTC to exec down-trend")
}
} else {
if (dif>0) {
chrome.browserAction.setBadgeBackgroundColor({color:[10, 100, 10, 100]})
} else {
chrome.browserAction.setBadgeBackgroundColor({color:[100, 10, 10, 100]})
}
}