Skip to content
Technical Indicators scripts for use in Cloud9Trader charts and trading algorithms
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
adl.src.js
aroon.src.js
aroonOscillator.src.js
atr.src.js
bollinger.src.js
bollingerB.src.js
bollingerBandwidth.src.js
cci.src.js Update to leverage support for nesting and historical price API Aug 18, 2014
chandelierExit.src.js
cmf.src.js
cmo.src.js
cog.src.js
coppock.src.js
dailyPivot.src.js
dpo.src.js
elderBBPower.src.js
ema.src.js
emaEnvelope.src.js
emv.src.js
fisherTransform.src.js Update to leverage support for nesting and historical price API Aug 18, 2014
forceIndex.src.js
gapo.src.js
ichimokuCloud.src.js
keltnerChannels.src.js
kst.src.js
macd.src.js
macdHistogram.src.js
massIndex.src.js
mfi.src.js
obv.src.js
pgo.src.js
pmo.src.js
ppo.src.js
priceChannels.src.js
pvo.src.js
qStick.src.js
roc.src.js
rsi.src.js
sma.orig.js
sma.src.js
smaEnvelope.src.js
standardDeviation.src.js
stochRsi.src.js
stochasticOscillator.src.js
trix.src.js
tsi.src.js
uo.src.js
volume.src.js
vtx.src.js
williamsR.src.js
wma.src.js

README.md

Technical Indicators

#####Technical indicator and overlay scripts for use in www.cloud9trader.com charts and trading algorithms.

These indicator scripts, written in JavaScript, power the built in technical indicators on the platform.

Their job is to derive a value, or set of values, from price data at any given moment in time to be drawn onto charts as one or several overlays or studies. They can also be used inside your Cloud9Trader trading scripts.

We've included them in this repository so that you can use them as a reference to help build your own indicators - just create a new indicator on the 'Algorithms' screen and copy the code in.

They're also here for those who are just interested in the maths behind technical analysis.

If you spot any issues with them or would like to add your own indicator to Cloud9Trader's built in collection, we'd be very grateful for your pull requests.

###Functions

The indicators will contain at minimum an 'onIntervalClose' function and some or all of the following:

  • onIntervalClose() Required. Called every bar close. Its job is to return the current indicator value(s) (and any chart config), so is generally where you'll find most of the logic.

  • onStart() Optional. Called once run up price data has loaded with any user input parameters. Used to validate these and initialize any variables that are globally scoped (i.e. persist between updates)

  • getRunUpCount() Optional. Tells the system how many intervals of previous price data to load in that are needed to produce the first value. This is often the n periods of the indicator. This is also called with any user input parameters.

  • getStudyAxisConfig() Optional. Configures the study chart axis for indicators that produce one.

###Documentation

You can find plenty of info for writing your own indicators in the Cloud9Trader documentation pages. See Writing Your Technical Indicators.

For the technical indicator API see Technical Indicators API Reference.

For the API for using these in your trading algorithms see Algorithms API Reference.

###Indicators

  • Accumulation Distribution Line adl()
  • Aroon aroon(periods)
  • Aroon Oscillator aroonOscillator(periods)
  • Average True Range atr(periods)
  • Bollinger Bands bollinger(periods, deviations)
  • Bollinger Bandwidth bollingerBandwidth(periods, deviations)
  • Bollinger %B bollingerB(periods, deviations)
  • Commodity Channel Index cci(periods, constant)
  • Chandelier Exit chandelierExit(periods, multiplier)
  • Chaikin Money Flow cmf(periods)
  • Chande Momentum Oscillator cmo(periods, signalPeriods)
  • Center of Gravity Oscillator cog(periods, signalPeriods)
  • Coppock Curve coppock(firstRoCPeriods, wmaPeriods, secondRoCPeriods)
  • Daily Pivot dailyPivot()
  • Detrended Price Oscillator dpo(periods)
  • Elder Bull/Bear Power elderBBPower(periods)
  • Exponential Moving Average ema(periods)
  • Exponential Moving Average EnvelopeemaEnvelope(periods, envelope)
  • Ease of Movement emv(periods)
  • Fisher Transform fisherTransform(periods)
  • Force Index forceIndex(periods)
  • Gopalakrishnan Range Index gapo(periods)
  • Ichimoku Cloud ichimokuCloud(conversionLinePeriods, baseLinePeriods, leadingSpanPeriods, laggingSpanPeriods)
  • Keltner Channels keltnerChannels(emaPeriods, atrPeriods, atrMultiplier)
  • Know Sure Thing kst(firstROCPeriods, secondROCPeriods, thirdROCPeriods, fourthROCPeriods, firstSMAPeriods, secondthirdSMAPeriods, fourthSMAPeriods[, signalSMA])
  • MACD macd(fastEMAPeriods, slowEMAPeriods[, signalEMAPeriods])
  • MACD Histogram macdHistogram(fastEMAPeriods, slowEMAPeriods, signalEMAPeriods)
  • Mass Index macdHistogram(emaPeriods, summationPeriods)
  • Money Flow Index mfi(periods)
  • On Balance Volume obv()
  • Percentage Price Oscillator ppo(fastEMAPeriods, slowEMAPeriods[, signalEMAPeriods])
  • Pretty Good Oscillator pgo(periods)
  • Price Channels priceChannels(periods)
  • Price Momentum Oscillator pmo(firstEMAPeriods, secondEMAPeriods[, signalEMAPeriods])
  • Price Volume Oscillator pvo(fastEMAPeriods, slowEMAPeriods, signalEMAPeriods)
  • QStick qStick(periods)
  • Rate of Change roc(periods)
  • Relative Strength Index rsi(periods)
  • Simple Moving Average sma(periods)
  • Simple Moving Average Envelope smaEnvelope(periods, envelope)
  • Standard Deviation standardDeviation(periods, envelope)
  • Stochastic Oscillator stochasticOscillator(periods, smaPeriods)
  • StochRSI stochRsi(periods)
  • TRIX trix(periods[, signalPeriods])
  • True Strength Index tsi(firstPeriods, secondPeriods[, signalPeriods])
  • Ultimate Oscillator uo(shortPeriods, mediumPeriods, longPeriods)
  • Volume volume()
  • Vortex Indicator vtx(periods)
  • Williams %R williamsR(periods)
  • Weighted Moving Average wma(periods)
You can’t perform that action at this time.