create account

Programming My Own Trading Chart - Part 34 - Generic Indicators in Alpha by leoplaw

View this thread on: hive.blogpeakd.comecency.com
· @leoplaw ·
$2.60
Programming My Own Trading Chart - Part 34 - Generic Indicators in Alpha
![TradeX-chart generic indicators provide config dialogues](https://files.peakd.com/file/peakd-hive/leoplaw/EoEiHkyFgxz25Y1UVKY6g6LHsbyv99baYkK1GUgn5nCemwyVcQ818cnoi4x2cvFnMYK.png)


TradeX has reached a major milestone. The inbuilt Indicator classes, which implement TALib, now only require configuration properties (objects) and the constructor class, with the parent class now building the entire indicator. 

I intend that custom indicators should be able to leverage much of this also, which will vastly simplify your code.

This also means your custom indicators will be able to use the in-built configuration dialogue. Imagine that! I've used other chart libraries in the past that force you to write your own.

At some point I will consider how the custom Overlay API could also be simplified. All of this will feed into the drawing tool development. Thus by extension, custom drawing tools will also a breeze.

Yes, I know the theme in the screen shot is ugly, but my time is better spent on code at the moment.

It's been quite a struggle to get to this point, since changing the basic config object structure meant refactoring a lot of convoluted code. That's the price when making things easy for the end user. Whereas, if I kept it simple for my self, no one is ever going to try to write their own custom indicators, overlays or tools.

But the upside is, as many times in the past, each rewrite I do, cleans and improves the code. I've often also discovered hidden bugs and eliminated them. So while painful and boring, it is a win win for everyone.


![Flow charting my way out of the labyrinth](https://files.peakd.com/file/peakd-hive/leoplaw/23wrC28Zh9MD7TE81TAMRbn7jzekr8SV1czBGDHY8UVwtNAFwwukYWQx5dPGDJRLzY4m9.webp)


I was lost in the labyrinth of code and was avoiding flow charting it, attempting to do the job by brute force, as the rationale was, time on the flow charting could be used coding instead. Wrong! I proved to myself yet again, that flow charting actually saves me far more time as it gives me a clear overview. In this instance, it revealed to me the duplication of a couple of functions, each written slightly differently, which produced frustratingly different results. Now the output is consistent.

There is still more work to polish up the generic indicators before it is pushed to GitHub and published to NPM. Until then you can try out the current version.

The chart is available via NPM

```
npm install tradex-chart
```

and GitHub

https://github.com/tradex-app/TradeX-chart
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 159 others
properties (23)
authorleoplaw
permlinkprogramming-my-own-trading-chart-part-34-generic-indicators-in-alpha
categoryhive-169321
json_metadata{"app":"peakd/2024.7.3","format":"markdown","tags":["programming","development","javascript","trading","chart"],"users":[],"image":["https://files.peakd.com/file/peakd-hive/leoplaw/EoEiHkyFgxz25Y1UVKY6g6LHsbyv99baYkK1GUgn5nCemwyVcQ818cnoi4x2cvFnMYK.png","https://files.peakd.com/file/peakd-hive/leoplaw/23wrC28Zh9MD7TE81TAMRbn7jzekr8SV1czBGDHY8UVwtNAFwwukYWQx5dPGDJRLzY4m9.webp"]}
created2024-07-22 20:14:54
last_update2024-07-22 20:14:54
depth0
children1
last_payout2024-07-29 20:14:54
cashout_time1969-12-31 23:59:59
total_payout_value1.300 HBD
curator_payout_value1.301 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,524
author_reputation189,628,210,789,149
root_title"Programming My Own Trading Chart - Part 34 - Generic Indicators in Alpha"
beneficiaries
0.
accounthive-169321
weight200
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id135,487,186
net_rshares8,031,027,895,846
author_curate_reward""
vote details (223)
@stemsocial ·
re-leoplaw-programming-my-own-trading-chart-part-34-generic-indicators-in-alpha-20240723t030152318z
<div class='text-justify'> <div class='pull-left'>
 <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div>

Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.&nbsp;<br />&nbsp;<br />
</div>
properties (22)
authorstemsocial
permlinkre-leoplaw-programming-my-own-trading-chart-part-34-generic-indicators-in-alpha-20240723t030152318z
categoryhive-169321
json_metadata{"app":"STEMsocial"}
created2024-07-23 03:01:51
last_update2024-07-23 03:01:51
depth1
children0
last_payout2024-07-30 03:01:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length565
author_reputation22,931,009,868,560
root_title"Programming My Own Trading Chart - Part 34 - Generic Indicators in Alpha"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id135,498,661
net_rshares0