Japanese Candlesticks with Roassal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Japanese Candlesticks with Roassal

Stefan Krecher-3
Hi,
I just started to get into Roassal (with Pharo 4.0) with the goal to visualize financial data like forex charts.
The common visualization is by using japanese candlesticks [1]
Because there is not predefined TRShape/ RTShape, I would need to create those shapes on my own.
I suspect that this task can't be too complicated but because I'm that very new to Roassal, I'm asking for some hints and maybe code examples.
The data needed to visualize one candlestick consists of a few numbers, e.g.
20150501 001300;1.120890;1.120910;1.120890;1.120900;0 (-> downloaded from [2])
First two numbers are Date and Time, the next four Numbers are: open, high, low, close, that last one is the volume and can be omitted.
There is a bar to describe the price movement (open/ close) and wicks that describe the highest course and the lowest course during that time frame. 
The above data describes a One-Minute-Candle.
So I'd really appreciate if anyone could give me hints or send me to the right direciction.
regards
Stefan


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Japanese Candlesticks with Roassal

akevalion
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Japanese Candlesticks with Roassal

Stefan Krecher-3
Milton,
thank you so much - I wasn't aware of that RTBoxPlotDataSet but managed to load it after a quick google research.
It looks almost perfect - adding color shouldn't be that complicated. And I would need to ged rid of these horizontal lines on top of the wicks.
Thank you for sending me to the right direction!
Regards
Stefan

2015-05-23 18:19 GMT+02:00 milton mamani <[hidden email]>:
Hi Stefan in Roassal2 there is Boxplot, similar as you want.

| b createList r d today |
r := Random new.
createList := [ :size :d1 :d2 | (1 to: size) collect: [ :i | d1 + (r next * (d2-d1))] ].

b := RTGrapher new.
today := d := Date today.
(1 to: 10) do: [ :i | | ds |
ds := RTBoxPlotDataSet new.
ds points: (createList value: 20 value: 0 value: 20).
ds model: d.
ds x: [ :date| date julianDayNumber - today julianDayNumber + 1 ].
b add: ds.
d := d next.].
b build.
^ b view.
 
Try to create a subclass of RTAbstractDataSet, such as RTCandlestickDataset

Cheers,
Milton


2015-05-23 6:54 GMT-04:00 Stefan Krecher <[hidden email]>:
Hi,
I just started to get into Roassal (with Pharo 4.0) with the goal to visualize financial data like forex charts.
The common visualization is by using japanese candlesticks [1]
Because there is not predefined TRShape/ RTShape, I would need to create those shapes on my own.
I suspect that this task can't be too complicated but because I'm that very new to Roassal, I'm asking for some hints and maybe code examples.
The data needed to visualize one candlestick consists of a few numbers, e.g.
20150501 001300;1.120890;1.120910;1.120890;1.120900;0 (-> downloaded from [2])
First two numbers are Date and Time, the next four Numbers are: open, high, low, close, that last one is the volume and can be omitted.
There is a bar to describe the price movement (open/ close) and wicks that describe the highest course and the lowest course during that time frame. 
The above data describes a One-Minute-Candle.
So I'd really appreciate if anyone could give me hints or send me to the right direciction.
regards
Stefan

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Japanese Candlesticks with Roassal

abergel
Hi Stefan,

Let us know how it goes…

Cheers,
Alexandre


> On May 23, 2015, at 9:57 PM, Stefan Krecher <[hidden email]> wrote:
>
> Milton,
> thank you so much - I wasn't aware of that RTBoxPlotDataSet but managed to load it after a quick google research.
> It looks almost perfect - adding color shouldn't be that complicated. And I would need to ged rid of these horizontal lines on top of the wicks.
> Thank you for sending me to the right direction!
> Regards
> Stefan
>
> 2015-05-23 18:19 GMT+02:00 milton mamani <[hidden email]>:
> Hi Stefan in Roassal2 there is Boxplot, similar as you want.
>
> | b createList r d today |
> r := Random new.
> createList := [ :size :d1 :d2 | (1 to: size) collect: [ :i | d1 + (r next * (d2-d1))] ].
>
> b := RTGrapher new.
> today := d := Date today.
> (1 to: 10) do: [ :i | | ds |
> ds := RTBoxPlotDataSet new.
> ds points: (createList value: 20 value: 0 value: 20).
> ds model: d.
> ds x: [ :date| date julianDayNumber - today julianDayNumber + 1 ].
> b add: ds.
> d := d next.].
> b build.
> ^ b view.
>  
> Try to create a subclass of RTAbstractDataSet, such as RTCandlestickDataset
>
> Cheers,
> Milton
>
>
> 2015-05-23 6:54 GMT-04:00 Stefan Krecher <[hidden email]>:
> Hi,
> I just started to get into Roassal (with Pharo 4.0) with the goal to visualize financial data like forex charts.
> The common visualization is by using japanese candlesticks [1]
> Because there is not predefined TRShape/ RTShape, I would need to create those shapes on my own.
> I suspect that this task can't be too complicated but because I'm that very new to Roassal, I'm asking for some hints and maybe code examples.
> The data needed to visualize one candlestick consists of a few numbers, e.g.
> 20150501 001300;1.120890;1.120910;1.120890;1.120900;0 (-> downloaded from [2])
> First two numbers are Date and Time, the next four Numbers are: open, high, low, close, that last one is the volume and can be omitted.
> There is a bar to describe the price movement (open/ close) and wicks that describe the highest course and the lowest course during that time frame.
> The above data describes a One-Minute-Candle.
> So I'd really appreciate if anyone could give me hints or send me to the right direciction.
> regards
> Stefan
>
> [1] http://en.wikipedia.org/wiki/Candlestick_chart
> [2] http://www.histdata.com/
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev