Back

Is Building Custom Charts Types Possible?

I want to create a charting script/program for a new type of stock chart. I need a data source consisting of trades, a library for graphing (consisting of lines and filled areas), as well as a good language for processing large amounts of trades.
Could this be done on QuantConnect using ChartIQ?
If not, or if it would be unwise, what programming languages/libraries/data feeds would be recommended?
Update Backtest








Welcome Vladimir, it sounds like there are a few different components to your challenge. 1 - New type of charting, and 2 - Data source, 3 - Backtesting/Processing. For simplicity I'd recommend just building 1, a new chart since that is the unique challenge.

To build a chart (assuming in a browser) you can use the HTML5 canvas commands. They let you draw lines and shapes in a defined space with code. Its no easy task, so recommend checking out all the open source libraries available -- there are dozens of charting libraries.
1

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Well, I've decided to scrap my original idea (a chart made up of volume profiles) due to poor aesthetics and the data required being rather cumbersome to handle and store. Instead, I've decided to use volume-weighted quartiles to replace the open and close values on a candlestick chart, still accomplishing my original intention of displaying the distribution of volume. As well as color coding volume relative to average volume, and I've yet to implement a fill system similar to heikin ashi charts.
Is it a good idea to continue with JavaScript/Html? Or should I use another language to generate the chart and then save it as an image? I'd like to display it in a webpage eventually and provide the data for download. I'm thinking about going with an Apache, MySql, and Python setup.

On a side and more appropriate note, I have been working on a trading algorithm and it seems to work very similarly to the sell in May strategy, except you go broke in May. What's a good book on algo trading you would recommend?
0


Vladimir, some books:

As good intro:
Rishi K. Narang "Inside the Black Box: The Simple Truth about Quantitative Trading"

As good intro of how strategies are constructed and their major types, with samples (in MATLAB):
Ernest P. Chan "Algorithmic Trading: Winning Strategies and Their Rationale"

More basic strategies (in Amibroker):
Dr Howard B Bandy "Quantitative Trading Systems"

Etc. :-)
1

Hey Vlad - for your charts I'd suggest improving what people already know, i.e., that volume is measured with bar charts. Its typically the bar chart on the bottom of the price chart. This is actually something QC is missing -- we should add it in :)

For your strategy - the most apparent thing is a lack of risk control or fine tuned entries or exits. Treat each trade as if it was actually using your account funds. You should generally also only risk 2% of your capital per trade in a technical trading system.

You might use an entirely different approach for entries and exits. The market isn't symmetrical so there's no reason for your strategy to use the same system :). The market is rising roughly 66% of the time, and falling 33% of the time. But on average it falls in larger steps.
1

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Thanks Tadas, I've started on Inside the Black Box. I didn't even think of using different entry and exit systems, the current symmetry in my algorithm is probably contributing to its issues. Meanwhile, implementing volume is first on my list once I settle on a way to deal with a secondary axis. Thanks for the help Jared, and it would be nice to see our trade volume on the charts.
0

I am also thinking what to do with chrting as currently I can only pcik some trades and place them on some desktop charting to see if they are done in the right place. But can't see where exactly filters going/behaving as sometimes trades are 1:1 to desktop chart and sometimes misplaced badly.
0

@Tadas I think there's a small bug in the custom charting which I'll fix today. Once its fixed you can generate your own custom stock plots and plot the price-trade positions.

The appearance of misplaced badly might just be intraday price movement - e.g. somewhere between the high and the low of the day. Most price charts only show the closing price.
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Trades are placed using some filters. And they work ok, but sometimes they are collapsing into one place (I think) and thus misplacement. Hard to say why because for this there is need to see where filter is placed in the sequence of bars (i.e. answer question does filter really collapsing). I am sure I can't say anything useful here at current moment.
0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed