Download MetaTrader 5

Find time at index 1

To add comments, please log in or register
Morgan Morden
682
Morgan 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: 

 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!

whroeder1
15902
whroeder1  
  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]
Fernando Carreiro
2839
Fernando Carreiro  
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.

Forum on trading, automated trading systems and testing trading strategies

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] ...

Morgan Morden
682
Morgan Morden  
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



To add comments, please log in or register