[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] DateTime() and DateTimeToStr question



PureBytes Links

Trading Reference Links

I'm trying to use the DateTime() function in the Title of an indicator 
to show what the *predicted future date/time* of an event might be. 
Before anyone groans(!) I'm not a complete novice and aware that my data 
cannot predict the future... :-)
However, I have an indicator which plots, amongst other things, a sine 
wave and I would like the Title to tell me what the date/time will be 
when the next peak or trough will occur based on the currently plotted 
wavelength.
Here is the relevant part of the code that I came up with before I hit 
the brick wall
(the "bars" variable is calculated previously in the code as the number 
of bars beyond the last bar in the chart where the peak or trough will be)

nextDateTime =  LastValue(DateTime()) + bars*Interval() ;     (I am 
guessing that this gives me a numerical value for the future date & time)

Title = ...."some stuff".... + "On " + DateTimeToStr(nextDateTime);

Problem seems to be that the functions do not like referencing beyond 
the last bar. The displayed string is always just the date & time of the 
most recent bar.

Can anyone help?
TIA

		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com