Created
January 20, 2019 11:59
-
-
Save Schellinkhoutkamp/b82cd2f2e30b50db542de714ff61b854 to your computer and use it in GitHub Desktop.
Jared algos
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
// BREAKOUT CLEAN | |
function sma(t, xc){ | |
som=0; xc=xc.slice(0,t); | |
for(i=0;i<xc.length;i++){som+=xc[i];} | |
return som/xc.length; | |
} | |
function pricemove (t, xc){ | |
return xc[0]-xc[t]; | |
} | |
INATRADE[0] = function(){ | |
INTRADE[0]=0; | |
if (XBTSMADIFF[0]>0&&XBTSMADIFF[0]>XBTSMADIFF[1]){return 1} | |
if (XBTSMAFAST[0]<XBTSMALONG[0]){return -1} | |
return INTRADE[1]; | |
}(); | |
XBTSMAFAST[0] = (sma(15,BNCE_XBTUSD)); | |
XBTSMASLOW[0] = (sma(45,BNCE_XBTUSD)); | |
XBTSMALONG[0] = (sma(60,BNCE_XBTUSD)); | |
XBTSMADIFF[0] = XBTSMAFAST[0]-XBTSMASLOW[0]; | |
XBTSMADIFFCHANGE[0]=XBTSMADIFF[0]-XBTSMADIFF[3]; | |
XBTMOVE[0] = (pricemove(9,BNCE_XBTUSD)); | |
LONG[0] = function(){ | |
if (XBTSMADIFF[0]>0&&XBTSMADIFF[0]>XBTSMADIFF[1]){return 1} | |
if (XBTSMAFAST[0]<XBTSMALONG[0]){return -1} | |
return 0; | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment