please help, i know i'm being stupid...

 

small problem but can someone please help me!!! just trying to draw a line on the last hour. So if it's say 22:45 it draws a vertical ine at 22:00


ObjectCreate(OH, OBJ_VLINE, 0, D'2008.01.24 22', open_price);

works fine, but i need it to be dynamic so its like Date() + TimeHour(TimeCurrent()) or something :(


please help

 

Maybe:

if (( TimeHour (TimeCurrent()) ==22)&&( TimeMinute (TimeCurrent())==0) )&&( TimeSeconds (TimeCurrent())==0) )

ObjectCreate(OH, OBJ_VLINE, 0, TimeCurrent(), open_price);

 
DxdCn:

Maybe:

if (( TimeHour (TimeCurrent()) ==22)&&( TimeMinute (TimeCurrent())==0) )&&( TimeSeconds (TimeCurrent())==0) )

ObjectCreate(OH, OBJ_VLINE, 0, TimeCurrent(), open_price);


That will wait until it's the 22 hour and draw a line as soon as it passes that time....BUT....i need it to draw a line on the last hour no matter how many minutes past it is.

ObjectCreate(OH, OBJ_VLINE, 0, TimeCurrent(), open_price);

is good but the TimeCurrent() needs to be just the hour and not the minutes or seconds. ...any ideas.


thanks for the help so far :)

 

no worries, i've figured it out, thanks for the help:



TMY1 = TimeSeconds(TimeCurrent()); // gives us the amount of seconds past the last minute
TMY2 = (TimeMinute(TimeCurrent())*60); // gives us the seconds upto the last minute past the last hour
TMY = TimeCurrent();
TMY = TMY - (TMY1 + TMY2); // gives us the amount of seconds that equal the start of the last hour

ObjectCreate(OH, OBJ_VLINE, 0, TMY, open_price); // draws a horizontal line on the last hour


thanks again for the advice.


ed

Reason: