• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 2:04am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 2:04am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

Indicator needed to show High/Low price of previous bar 14 replies

3 Bar Fractal with mid-bar and bar on each side 8 replies

Recording high and low point of each trade. MT4 3 replies

Pin bar, pin bar, pin bar 0 replies

How can you limit the number of orders in each bar? 4 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

Can u point me to code 2 show each bar with a higher high & higher low?

  • Post #1
  • Quote
  • First Post: Apr 27, 2010 10:02am Apr 27, 2010 10:02am
  •  Pvj
  • | Joined May 2009 | Status: Member | 55 Posts
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.
  • Post #2
  • Quote
  • Apr 27, 2010 2:46pm Apr 27, 2010 2:46pm
  •  nightyhawk
  • | Joined Sep 2009 | Status: Member | 296 Posts
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() {
   
IndicatorDigits(Digits+1);
   
SetIndexStyle(0,DRAW_ARROW);
   
SetIndexBuffer(0,ExtSignalBuffer);
   
SetIndexArrow(0,252); 
  return(
0);
} 
PHP Code:
int start() {
  
int limit;
  
int counted_bars=IndicatorCounted();
  if(
counted_bars>0) counted_bars--;
  
limit=Bars-counted_bars;
  
  for (
int i = 0; i<limit; i++) {  
    
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;
    }

  }
} 
  • Post #3
  • Quote
  • Last Post: Apr 27, 2010 9:01pm Apr 27, 2010 9:01pm
  •  Pvj
  • | Joined May 2009 | Status: Member | 55 Posts
Thankyou nightyhawk.

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

Rgds
  • Platform Tech
  • /
  • Can u point me to code 2 show each bar with a higher high & higher low?
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2021