tradovate / custom-indicators

Step-by-step tutorial for Tradovate custom indicators
22 stars 2 forks source link

Color picker param not available in UI #2

Closed tikidave closed 5 years ago

tikidave commented 5 years ago

Inside the predef module, there is a color option:

color(defValue) {
    return {
        type: ParamType.COLOR,
        def: defValue
    };
}

I have implemented it in the params code this way:

params: {
    upColor: predef.paramSpecs.color('lime'),
    downColor: predef.paramSpecs.color('red'),
},

When the indicator is added, the color pickers are not available in the UI:

image

However it does pick up the default props in the indicator:

style: {
    value: {
        color: close > priorClose ? this.props.upColor : this.props.downColor
    }
}

image

victorwins commented 5 years ago

Here is a spec for parameter: https://tradovate.github.io/custom-indicators/params.html When a new parameter type will be available on all our platforms, the doc will be updated.