In the monthly chart, the volume field (of a quotes database) sums the entire months volumes and plots it. How can we do something similar for the fields
from a custom database? I mean, instead of picking only the last value of the month, it sums every day's value and plots that monthly sum in the monthly chart.
Similarly, for the weekly chart also. Doing a "volume-like" summing for the entire week and plotting it on the weekly chart for a custom database field.
Another possible enhancement on this can be to give the parameter control to choose what calculation to be applied. While in this case, it is made for sum, parameter can be added where the following modes of calculation can be chosen to be applied:
1. avg (averaging the values for the time-frame)
2. start (opening value of the time-frame)
3. max (max value during the time-frame)
4. min (min value during the time-frame)
5. last (last value during the time-frame)
The beauty of this is that we can have a weekly/monthly candlestick display of a non-price custom database field.
Another interesting twist for this sort of a function. The thought process goes back something like this. In a monthly chart, the indicators are computed based on the month-end closing prices. I always used to think why there should be some sanctity for the last price of the month and how logical it is to let that single value represent the whole month in an indicator construction. I do agree that it is logical on the weekly time-frame as the Friday close before the week-end break has sanctity. Wouldnt it be great in order to compute a monthly indicator, instead of taking only the last price of the month, if we can take an entire month's average price? I mean the entire months average (taking all the daily closing prices for the month).
This would then mean making this function more global. Currently, it is for getdata which is for calling fields from a custom database. In order to accomplish the above, it would mean making it available for getseries also which calls the quotes database with the calculation method as "average" apart from "sum". Another use of a "getseriessum" kind of function is that some of the composites which are based on the sum-calculation can be plotted on the weekly and monthly charts without the need to re-create seperate composites for these time-frames. I mean, once the composite on the daily time-frame is created (which is based on the sum-calculation method), same can then be used for higher time-frame too.
Just shared some thoughts in case you find it worth looking at.
With gratitude.
Really great stuff. When we create a monthly indicator based the daily close average for the entire month, it does make differences for certain indicators like RSI. While an MACD, etc may not show much difference. But the function gives food for thought for further insights.
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.