![]() ( (int(column(countColumn)) % N = 0) ? stringcolumn(labelColumnNum) : "" ) Additionally you can skip dates and plot only the nth dates (if for example you only want every 5th date as label):ĮveryNth(countColumn, labelColumnNum, N) = \ Using a little trick mitigates that problem: In Gnuplot one can define a function, which looks in row 1 (the dates) and uses that as labels for column 0 (the fictional index). But of course you lose the dates on the x-axis (instead it is labelled with 1,2,3.,n). If you plot the index of rows instead of the date itself (if your data doesn't contain an index, use the fictional row '0'), the chart itself looks nice without gaps. ![]() So I looked for a workaround for this issue. ![]() Looks like the x-axis is just equally filled if data values are missing. Everytime Gnuplot stumbles upon such a "gap" in the data, it plots a gap in the chart. BUT: the data file naturally does not contain data for weekends and holidays (nor a date for these days). In this case the x-axis is formatted with the dates as legend. Now my first try was to plot all data using the first (date) column. we definitely need a legend, but first things first): As you can see, in this example there are two signals on this day: K-X (which stands for Kijun Cross) and KB (which stands for Kumo breakout. One example is the following line (your resolution might affect the number of rows that you see, in the file it is one single line of data). Signal4_name signal4_descr signal4_quote īecause Ichimoku has five kinds of different signals, in theory all 5 signals could occur simultaneously, so the datafile has placeholders for that (pretty rare) case.īelow that header follows the actual data, also separated by colons. Signal3_name signal3_descr signal3_quote Signal2_name signal2_descr signal2_quote Senkou_B signal1_name signal1_descr signal1_quote The csv file I use for plotting is generated by my program and contains all price and signal data (all in one line as header):ĭate open high low close tenkan kijun chikou senkou_A ![]() If you think "STOP babbling, gimme the code!"- just skip this text and move straigth to the end of this article. If anyone anytime tries something similar, here come the biggest stumbling blocks. Pretty ok for a couple of hours googling and c&p'ing, isn't it? :) In the end Gnuplot is no rocket science, the links that brought me closer step by step are attached below. To show off in the beginning, the current output (like you see in the signal/ weekly overview blogposts), click to enlarge: The best part: it is free and open source software, free as in free speech AND free beer! :) And of course, to conclude the teaser with shameless name-dropping: picking up a code snipped John Bollinger posted more than 11 years ago! So I spend a couple of evenings with Gnuplot, googling and playing around. Almost instantly Gnuplot came to my mind, a scientific plotting utility with scripting capabilities. Not because I needed it for the actual trading, but for debugging the signal generation part (and of course enhance my signal posts on this blog with some visuals). When I made the initial design/architecture of my (future) trading system framework, I added a charting component to my wishlist. After posting a lot of charts and chart snippets lately, I thought I could share some ideas (and code :)) with whoever is interested in Gnuplot. This is an updated version of an article I originally posted in German (change language with the little flags in the upper right).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |