sanders4069:
I am trying to get the highest high/ lowest low of last 4 weekly bars. The code works when I have it on the weekly timeframe, but when I switch timeframes it changes the value to the highest/lowest of whatever bars are there. So for example I am backtesting an EA on 5min data, and it is using the high/low of last 5min bars, instead of weekly bars. Any ideas why? Thanks in advance.
double fourWeekHigh = iHigh(NULL, PERIOD_W1, iHighest(NULL, PERIOD_W1, MODE_HIGH, 4,1)); double fourWeekLow = iLow(NULL, PERIOD_W1, iLowest(NULL, PERIOD_W1, MODE_LOW, 4, 1));Maybe change it like....
deVries:
Maybe change it like....
Maybe change it like....
We have a winner, thanks for the help!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am trying to get the highest high/ lowest low of last 4 weekly bars. The code works when I have it on the weekly timeframe, but when I switch timeframes it changes the value to the highest/lowest of whatever bars are there. So for example I am backtesting an EA on 5min data, and it is using the high/low of last 5min bars, instead of weekly bars. Any ideas why? Thanks in advance.