Financial indicators in Javascript / HTML5
Financial indicators in Javascript / HTML5
Hi,
Does teechart support financial indicators in Javascript / HTML5? I couldn't find any about this. If it's possible where I can find example to integrate it?
Does teechart support financial indicators in Javascript / HTML5? I couldn't find any about this. If it's possible where I can find example to integrate it?
Re: Financial indicators in Javascript / HTML5
Hello,
I'm afraid TeeChart Javascript/HTML5 doesn't include functions like the other versions.
However, you can always do the calculations from your main series and add the according points to an extra series manually.
Don't hesitate to let us know if you find any problem with that.
I'm afraid TeeChart Javascript/HTML5 doesn't include functions like the other versions.
However, you can always do the calculations from your main series and add the according points to an extra series manually.
Don't hesitate to let us know if you find any problem with that.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Financial indicators in Javascript / HTML5
Thanks for your answer. May you apply an example how to integrate some of these Trend line, Bollinger, MACD?
Re: Financial indicators in Javascript / HTML5
Hello,
A simple example would be this kind of mean function:
A simple example would be this kind of mean function:
Code: Select all
var Chart1;
function draw() {
Chart1=new Tee.Chart("canvas1");
candle1 = new Tee.Candle();
Chart1.addSeries(candle1);
candle1.addRandom(20);
msecsInADay=86400000; //24*60*60*1000
candle1.data.x=new Array(candle1.count());
var now=new Date(), tmp;
for (t=0; t<candle1.count(); t++) {
tmp=new Date(now.getTime() + t * msecsInADay);
candle1.data.x[t] = tmp;
}
Chart1.legend.visible = false;
myLineFunc1 = new MyLineFunc();
Chart1.addSeries(myLineFunc1);
myLineFunc1.data.source = candle1;
myLineFunc1.fillFromDataSource();
Chart1.draw();
}
MyLineFunc=function(o,o2) {
Tee.Line.call(this,o,o2);
this.fillFromDataSource=function() {
if (this.data.source instanceof Tee.Series) {
s = this.data.source;
sum = s.data.close.reduce((a, b) => a + b, 0); //sum of close values in the candle
mean = sum / s.count();
this.data.values = [mean, mean];
this.data.x = [s.data.x[0], s.data.x[s.count()-1]];
}
}
}
MyLineFunc.prototype=new Tee.Line();
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Financial indicators in Javascript / HTML5
It will help us thanks a lot!
Re: Financial indicators in Javascript / HTML5
Hi again,
we need from your help about the Bollinger Bands indicator
The bands are calculating from all data as is below: but the lines are very curved now. We want to make lines more smooth and straight.
When try to use only one fifth part of all data we lost the lines as is below: Please advice how can achieve it.
we need from your help about the Bollinger Bands indicator
The bands are calculating from all data as is below: but the lines are very curved now. We want to make lines more smooth and straight.
When try to use only one fifth part of all data we lost the lines as is below: Please advice how can achieve it.
Re: Financial indicators in Javascript / HTML5
Hello,
It's difficult to guess what are you exactly doing. Could you please arrange a simple example we can run as-is to reproduce the situation here? (note our Bug Fixing Policy).
It's difficult to guess what are you exactly doing. Could you please arrange a simple example we can run as-is to reproduce the situation here? (note our Bug Fixing Policy).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Financial indicators in Javascript / HTML5
When were start to prepare a simple example in the meantime we found the mistake.
Sorry for the unnecessary post.
Sorry for the unnecessary post.
Re: Financial indicators in Javascript / HTML5
Hello,
I'm glad to hear it!
I'm glad to hear it!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |