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.
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!
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.
hparadigma: I am find difficulty when I facing weekend date
|
|
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,- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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?