Tarea técnica
Нужно перевести код индикатора с tradingview (javascript) на платтформу jForex (java) от Dukascopy.
Код не длинный - 100 строк.
// HODL Stick v.4, 21.8.2015
// Part of Project HODL
// Author: @hodl (
http://hodl.org)
//
// supports custom timeframe
//
// evaluates candles and plots a line graph
// shows sentiment,
divergences, patterns, horizontal and trendline support and resistance...
// works best with HODL SR - Support & Resistance ()
// find
documentation, examples & screencasts on http://hodl.org/#hodlstick
// support: PM @hodl, http://hodl.org/#contact
//
// If you have suggestions or discovered new patterns, don't hesitate to
share with me & community
//
//
// Support development:
// BTCBeerJar: 1JFJRXKX2TWztR6reNNN3ngqiDRQ1cjRQt
// Subscribe to HODL SR (you won't
regret it) -
// If you use this code or part of the code, don't forget to credit hodl.org and link to the source
study("Hodl Stick v.4", precision=1)
//
inputs
customTf = input(false, 'Custom Timeframe?', bool)
customTfVal = input('60', 'Custom Timeframe:', resolution)
timeframe
= customTf?customTfVal:period
calcCandle()=>
o = open
c = close
h = high
l = low
v =
volume
candleHeight = h-l
bodyHeight = abs(o-c)
topBody =
o<c?c:o
bottomBody = o<c?o:c
topWick = h-topBody
bottomWick = bottomBody-l
previousStrenght = candleHeight/nz(candleHeight[1])
wickStrenght = nz((topWick-bottomWick) / candleHeight)
bodyStrenght = nz((o-c) / candleHeight)
candleStrenght = avg(wickStrenght, bodyStrenght) * -1
candleStrenght
out = security(tickerid, timeframe, calcCandle())
cum
= cum(out)
col = cum > cum[1]?green:
cum < cum[1]?red:yellow
pStick = plot( cum,
color=col, title="HODL Stick")
pOverlay = plot( cum[1], color=yellow, offset=-1, title="Overlay Line")