would that work: Time[-1] or s.th simular?

 

Hi,

it works fine in the Stretagy-Tester if I enter Objects placed in the 'future' of the modelled time.

But would that work on the real market chart as well:

   ObjectCreate(id, OBJ_TREND, 0, iTime(Symbol(),PERIOD_M30,0)-1, BuLim, iTime(Symbol(),PERIOD_M30,0)+(30*60-1), BuLim );

iTime(Symbol(),PERIOD_M30,0) - 1 => start the trend-line 1 second before the 'hypothetical' actual 30m-Bar
iTime(Symbol(),PERIOD_M30,0) + (30*60-1) => end the line at the last second before the 'hypothetical' future bar of a 30-chart.

The background is simply a call of my indicator (iCustom(Symbol(),PERIOD_M30, ...) let's say on a m1-chart while the indicator calculates Buy- and Sell-limits on the m30-charts.
Now don't want to repaint the Limit-lines on every new tick by my indicator, but have that Limit-lines for the actual 30 minutes, 'elongated' automatically by the terminal.

Thanks in advance,
Gooly

PS: Thanks as well to the one who eliminated some of the static topics from the first page of the forum!

 
gooly:

Hi,

it works fine in the Stretagy-Tester if I enter Objects placed in the 'future' of the modelled time.

But would that work on the real market chart as well:

iTime(Symbol(),PERIOD_M30,0) - 1 => start the trend-line 1 second before the 'hypothetical' actual 30m-Bar
iTime(Symbol(),PERIOD_M30,0) + (30*60-1) => end the line at the last second before the 'hypothetical' future bar of a 30-chart.

The background is simply a call of my indicator (iCustom(Symbol(),PERIOD_M30, ...) let's say on a m1-chart while the indicator calculates Buy- and Sell-limits on the m30-charts.
Now don't want to repaint the Limit-lines on every new tick by my indicator, but have that Limit-lines for the actual 30 minutes, 'elongated' automatically by the terminal.

Thanks in advance,
Gooly

PS: Thanks as well to the one who eliminated some of the static topics from the first page of the forum!

That makes no sense, indice 0 is current candle. Positive values are past (closed candle). You can't use future value, they don't exist.
 
angevoyageur:
That makes no sense, indice 0 is current candle. Positive values are past (closed candle). You can't use future value, they don't exist.


wrong - I guess.

time has to be transformed into x-dimensional pixel-index.>
The first visual pixel column might have the index 0. Iif a future-time is mathematically transformed into an pixel index you might get an index that is bigger than the index of the last visual index column, but this changes every new bar.

Finally in the strategy tester it works to create Objects in the future compared to the modelled time!

 
angevoyageur:
That makes no sense, indice 0 is current candle. Positive values are past (closed candle). You can't use future value, they don't exist.


I have no problem adding objects to the right of bar 0 by adding whatever seconds are necessary
 
gooly:

wrong - I guess.

time has to be transformed into x-dimensional pixel-index.>
The first visual pixel column might have the index 0. Iif a future-time is mathematically transformed into an pixel index you might get an index that is bigger than the index of the last visual index column, but this changes every new bar.

Finally in the strategy tester it works to create Objects in the future compared to the modelled time!


Sorry I read too fast and not attentively as your title talk about Time[-1].
 
GumRai:

I have no problem adding objects to the right of bar 0 by adding whatever seconds are necessary
You just have to be a little aware of what happens before the weekend, close at the end of the week + 1 hour != 1 hour into the open of trading.