## [0.8.0] - 2020-10-15
- Timezones (initial support)
- Extended shader props
- Show/hide scalebars (via chart-config sizes)
- Chart section resizing [Ext]
- Linked charts [Ext]
- Shift + drag => Measure
- Various bug kills and memory leak demolitions
- Scripts: onrange exec, node.js SE exec (opt)
- Scripts: added support of 'tf', 'range'
- Updated RangeTool
- Datasets, very first try
- 30% build size decrease
@arul67800
1) Timeframes, there's an example here https://github.com/tvjsx/trading-vue-js/blob/master/test/tests/Timeframes.vue
In that example, data is getting from a json file. But in my app, I'm getting data from Binance API for testing.
2) You can create indicators such as SMA, EMA, BB, Stoch... using custom overlays. You can find a collection of indicator overlays made by the TradingVueJs community here https://github.com/tvjsx/tvjs-overlays
Then use Datacube add method
to add an indicator to the chart. https://github.com/tvjsx/trading-vue-js/tree/master/docs/datacube#add-side-overlay
@arul67800 Not sure which stream you're planning to use, but you can get an idea from this demo https://github.com/tvjsx/trading-vue-js/blob/master/test/tests/DataHelper.vue
Or you can try socket.io if you're building your own stream
@C451 Sorry to trouble you. I've go through the script test demo then checked SMA function in script_std.js file. But what I understood is that function going through all the visible candles and get SUM of last x candle starting from each visible candle. Is there any way to get only last x candles data?
Hope my question is understandable 😊 For the time being I'm getting candles data using DC.get_one('chart'), inside the draw function on my custom overlay. But I'm not sure this is the optimized way to do it.
Thanks
init: `
// here you calculate your sum
for (var i = 0 ...) { ohlcv[i] }
`,
post: `
// here you post it to the settings:
settings({ result })
`
@MhdBssd_gitlab Basically you have to pass the previous candle to candle.js file from candle.vue (Modify this line for that new Candle(this, ctx, c)
) This is what I did 👇
1) Changed this for of for (var c of cnv.candles) {
to loop to normal loop for (let i = 0; i < cnv.candles.length; i++) {
2) Instead of this new Candle(this, ctx, c)
➡️
const pc = i != 0 ? cnv.candles[i-1] : undefined; // previous candle
const c = cnv.candles[i]; // current candle
new Candle(this, ctx, c, pc); // sending both candles
3) change constructor function in candle.js to retrieve the previous candle ex: constructor(overlay, ctx, data, prev)
then pass it to draw function this.draw(data, prev);
4) Inside draw function do whatever logic you need and change body & wick colour
## [0.9.0] - 2020-11-17
* Scripts: advanced samplers (sym() function)
* Implemented Dataset ops (update, merge, remove)
* Countless small bug fixes as always
* Scripts: add onclose()
* Fixed auto-scroll (when new candle is added)
* Scripts: offchart/onchart updates
* DC: aggtool v2 (completely rewritten)
* Custom legend buttons (your custom icon)
* Tool groups
* Scroll wheel modes: prevent, pass, click
* WebWorker RAM limit
* LineTool: add Ray mode
* Legend buttons handlers [EXT]