| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Calculating indicator in other timeframes than the one visualized?
A few months ago I saw a system/indicator that calculated it's values based on other timeframes, than the one present for visualization. Ex. I'm looking on H4-charts, but I want to know the value for H1 avg true range.
(yes, I can do this manually, but its for an ea) I don't remember how they solved this, anyone got any ideas? It seems very complex to me to save all pricedata within the H4 bar of 1m, and then convert to H1 within the indicator. I think (hope) there's an easier way.. /Johan |
|
||||
|
Quote:
Take a look : double iATR( string symbol, int timeframe, int period, int shift) I bolded 2 important parameters to do it. First is the timeframe which you want to read. Second is the shift of value ON REQUIRED timeframe according to current timeframe. eg. if you wish to read m1 current bar atr on h4 timeframe you should write it like that : double iATR(Symbol(), 1, 14, 0); if you wish to read closed m1 bar atr: double iATR(Symbol(), 1, 14, 1); Hovever if you want to do somethig like read h4 value on m1 timeframe then you need to use iBarShift function as last param.
__________________
You need proffesional mql coder? Contact me! I will help you! ........................................ http://www.fxservice.eu/ ........................................ |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| several timeframes in one MTF indicator | fxbs | Indicators - Metatrader 4 | 0 | 05-18-2007 06:46 AM |
| Calculating a moving average of an indicator in EA? | forex123 | Expert Advisors - Metatrader 4 | 1 | 05-05-2006 12:28 PM |