# Find time at index 1

682

I have indexs in my code and I want to know the amount bars/ time from signal point and index.

here is my code:

``` if (a[1]>=a[MaxIndex]) = OP_BUY;

```

I  I want to know amount of bars between signal point and MaxIndex. How do I find time at MaxIndex?

Thankyou!

15902

1. We have no idea what a[] is.

2. fabiano Morden: I have indexs in my code and I want to know the amount bars/ time from signal point and index.
If you have two indexes, then the bars between them is i2-i1+1 (inclusive.) Between bar 10 and bar 8 is three bars, 8, 9, and 10..
3. The duration (in seconds) from the start of the first bar to the start of the second bar is Time[i2] - Time[i1]
2839

fabiano Morden: I have indexs in my code and I want to know the amount bars/ time from signal point and index. here is my code: I  I want to know amount of bars between signal point and MaxIndex. How do I find time at MaxIndex?

This is a similar question to your other thread to which a similar answer was given already! So please don't double post and just continue on the same thread if you don't understand and need more help about the same subject.

Time difference between two indexes.

Doerk Hilger, 2017.09.13 01:02

Really? How bout index2-index1 ... ? ... and the absolute time with time[index2]-time[index1] ...

682

whroeder1:
1. We have no idea what a[] is.

2. If you have two indexes, then the bars between them is i2-i1+1 (inclusive.) Between bar 10 and bar 8 is three bars, 8, 9, and 10..
3. The duration (in seconds) from the start of the first bar to the start of the second bar is Time[i2] - Time[i1]

Sorry I was a little unclear.

a[1] is current price/time [i]. I want to know amount of bars from MaxIndex to current price[i] where Maxindex is surpassed