| / | Forum |
|
spillsome
2006.10.07 18:58
I would like to know how to calculate the number of bars since the last time my
2 ema crossed.
What to use, iBarShift ? and how ? |
|
Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization This article dwells on implementation algorithm of simplest trading systems. The article will be useful for beginning traders and EA writers. |
|
irusoh1
2006.10.07 19:31
If you have the time when they crossed you can use iBarShift. It will give you the index of the bar at certain time.
If you don't then you need to count bars in a loop from 0 upwards until ema cross. |
|
spillsome
2006.10.12 12:07
irusoh1 wrote: If you have the time when they crossed you can use iBarShift. It will give you the index of the bar at certain time. If you don't then you need to count bars in a loop from 0 upwards until ema cross. thanks, do you have an example of code that loop from 0 upwards until ema cross ? |