Click here to Login

                                                   Date addition and substraction


2021-08-31 20:58:12

In custom drawing tool, how can you substract two dates (objects) to get difference of number of days between two dates.
DateTime date1; DateTime date2; DateTime date3; ?
date3 = date2 - date1;

Thank you

2021-09-02 11:33:08


in C# (since custom drawing tool uses that), here is how to do that:
int days = date2.Subtract(date1).Days;

2021-09-04 19:47:12


Thanks, there is almost nothing Quantshare can't do :)

No more messages


No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"


Trading Items
Equity and Date Export To Excel
iShares ETFs - Class, Total Net Assets, Inception Date and Number...
Days To Next Date
Number of Days to a Specific Date
Year to Date Change Indicator

How-to Lessons
Difference between the watchlist and the screener tools
How to download EOD quotes for active and valid stocks only
How to plot support and resistance lines automatically
How to create and trade a Neural Network model
How to scale and move the chart Y-axis

Related Forum Threads
Lookup Earnings Announcement date and trade on post-earnings day
Visible Date of first and last bar on chart
Changing Colour of Graph Crosshairs and Date OHLC values
Synchronize stock charts for symbol and date
How to read date and get quote of next day.

Blog Posts
How to Scan for Parallel Resistance and Support Lines
4 Links to Download Free Historical Stock Prices Data by Date
How to build and backtest a robust stock trading system
Fundamental Screen based on Stock price, ROI and Market capitaliz...
Create indicators, composites and trading systems using QL and CS...

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2022
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Follow us on Google+
RSS Trading Items

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.