Forex Factory (
-   Platform Tech (
-   -   Can u point me to code 2 show each bar with a higher high & higher low? (

Pvj Apr 27, 2010 10:02am | Post# 1

Can u point me to code 2 show each bar with a higher high & higher low?
Hi - noobie in MT4 coding.

I want to highlight each and every bar that matches my test - for backtesting and future trade identification.

I'm guessing that it should be a script - or should it be something else.

If you could point me to some example code that 'highlights' each bar with a higher high and a higher low than the previous bar (or similar easy example) I think that I could take it from there.

Thankyou for any help.

nightyhawk Apr 27, 2010 2:46pm | Post# 2

PHP Code:
#property indicator_chart_window
#property  indicator_buffers 1
#property  indicator_color1  Gray
#property  indicator_width1  1

double ExtSignalBuffer[]; 
Define indicator!

PHP Code:
int init() {

PHP Code:
int start() {
int limit;
int counted_bars=IndicatorCounted();
  for (
int i 0i<limiti++) {  
ExtSignalBuffer[i] = EMPTY_VALUE;
    if (
iHigh(Symbol(), Period(), i) > iHigh(Symbol(), Period(), i+1) &&
iLow(Symbol(), Period(), i) > iLow(Symbol(), Period(), i+1)) {
ExtSignalBuffer[i] = iLow(Symbol(), Period(), i) - 20*Point;


Pvj Apr 27, 2010 9:01pm | Post# 3

Thankyou nightyhawk.

This works fine - I should be able to take it from here.


© Forex Factory