I have a specific future date and need to plot a verticle line on the right margin of the chart. Can someone give me a hint what is the easist way to do this? I have seen discussions on how to draw a verticle line in the chart, but having difficulty to draw it for a future bar because DataNum does not work for future date.
The only way to do that is to use low-level GFX http://www.amibroker.com/guide/h_lowlevelgfx.html You would need to calculate "X" coordinate yourself, in pixels. Trouble is that you don't really know what the future will be therefore you must assume what trading days will be. The easiest approach can be assuming that you got a session every working day, but that is not always true.
I think I am quite ok working with the assumption that we have trading day for each future working day. Is there a similar function as DateNum but allow me to specify the last date? This way, I can use plot with shift to draw the line easily. Caluclating X-coordinate myself is a big no-no to me.
Currently, I can draw verticle line on the right margin manually. So internally, the system must have a way
Thanks for trying to answer my post. Sorry that I did not express myselff clearly. I know about these two functions: DateNum() and LastValue(). I have been using them a lot. The problem with DateNum() is that it does not take any parameter. It assumes the last date is today. If there is a similar function as DateNum() but allows me to specify the last date (such as a future date), then the generated dn array will be very useful and I can search for bar location using Lookup() giving a specific date. This will facilitate me to draw verticle line with the plot function for future date with the shift parameter.