can anyone tell me how I can draw object in future time

Back to topics list To post a new topic, please log in or register
avatar
50
netFX 2012.05.06 15:55
 

I am trying to dra object using Object create function giving properly time and price coordinates. As far as time coordinate is concered if it Time[n] where n=0,1,2,... it is ok. I have no problem drawing object but hen I use n= -1,-2,-3,..... it desnt draw on future bar postions. I get time value corresponding to Time[-1],Time[-2]... as 1970.01.01. Not sure how I can draw objects on chart on future time.

I would appreciate is anyone can through some light on this?

 
avatar
14167
RaptorUK 2012.05.06 16:02 #
 
You don't draw Objects using bar number you use datetimes . . . so use datetimes . . . if you want an Object at "time[-1]" use time[0] + ( Period() * 60 ) . . . of course this is problematic during a weekend . . . or when a weekend is between now and when you want your object placed . . .
 
avatar
50
netFX 2012.05.06 16:10 #
 
RaptorUK:
You don't draw Objects using bar number you use datetimes . . . so use datetimes . . . if you want an Object at "time[-1]" use time[0] + ( Period() * 60 ) . . . of course this is problematic during a weekend . . . or when a weekend is between now and when you want your object placed . . .

Excellent. Thanks a lot. it works.
avatar
18
Expertusaureus 2012.12.14 15:17 #
 
RaptorUK:
You don't draw Objects using bar number you use datetimes . . . so use datetimes . . . if you want an Object at "time[-1]" use time[0] + ( Period() * 60 ) . . . of course this is problematic during a weekend . . . or when a weekend is between now and when you want your object placed . . .

Thanks Moderator! You also helped for me!

 

avatar
2
hparadigma 2015.11.24 06:34 #
 

Hello, I am trying to draw object in future time (the time after index 0) using "time[0] + ( Period() * 60 )". I am find difficulty when I facing weekend date because the object that I want to create is passing weekend data. More over, I find more difficulties when I want to create object between past time (the time before index 0) and future time (the time after index 0), as we know the past time axis does not include weekend data but the future time axis does include weekend data.

Does anyone has any tips to write the code for this case in simple way? I will very appreciate for any tips that you share.

avatar
12995
WHRoeder 2015.11.24 13:32 #
 
hparadigma: I am find difficulty when I facing weekend date
  1. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
  2. Time[0 + n * PeriodSeconds() will work until the start of the new week (or past market holiday.) Then move the end point.

avatar
2
hparadigma 2015.12.01 06:48 #
 

Hello mr WHRoeder,

Thank you for your response.

1. Yes. You are right, sir. My question was not clear. I have some difficulties (confusion exactly) to described my problem because I was writing a multi time frame indicator. So I just asking in general term. I am sorry. Next time, I will described my problem clearly.

2. I have solved my problem about putting an object on the chart especially when facing weekend data using (Time[0] + n * PeriodSeconds()). Thank you sir.

warm regards,



Back to topics list  

To add comments, please log in or register