getDataOutput (SDK Trading)

getDataOutput is a Fintechee API to get the outputted data of the custom indicator.

getDataOutput(context, name) ⇒ array

Indicator SDK This function gets data output.

Kind: global function
Returns: array - data output of indicator.

Param Type Description
context object the name should be the same with the name of parameter of indicatorFunction
name string specifies the name of the data output of indicator

getDataOutput (SDK Trading)

registerIndicator("name", "desciption", function (context) {
    var dataInput = getDataInput(context, 0)
    var dataOutput = getDataOutput(context, "output")
    var shift = getIndiParameter(context, "shift")

    var calculatedLength = getCalculatedLength(context)
    var i = calculatedLength

    if (i == 0) {
        dataOutput[0] = 0
        i++
    } else {
        i--
    }

    while (i < dataInput.length) {
        dataOutput[i] = Math.random()
        i++
    }

    if (shift != null && calculatedLength == 0) {
        setIndiShift(context, "output", shift)
    }
},[{
    name: "shift",
    value: 5,
    required: true,
    type: "Integer",
    range: [-10,10]
}],
[{
    name: DATA_NAME.CLOSE,
    index: 0
}],
[{
    name: "output",
    visible: true,
    renderType: RENDER_TYPE.HISTOGRAM,
    color: "steelblue"
}],
WHERE_TO_RENDER.SEPARATE_WINDOW)