Forex



Go Back   Forex Trading > Downloads > Indicators - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 01-27-2007, 01:47 PM
Junior Member
 
Join Date: Nov 2006
Posts: 7
iwan is on a distinguished road
Daily HL foreground

Hallo


I am using "day HL" indicator which displays (as two lines) yesterday's high and low on today's chart.
Is this possible to delete this lines (for more clarity of the chart) and change foreground colour beetwen them?

This is formula of "dayHL" indicator.
Thanks for help
Iwan

//+------------------------------------------------------------------+
//| dayHL_Average.mq4 |
//+------------------------------------------------------------------+
/*
Name := dayHL_Average
Author := KCBT
Link := http://www.kcbt.ru/forum/index.php?
*/

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color3 Red
//---- input parameters5
extern int show_comment=1; // comments on the chart (0 - no, 1 - yes)
extern int how_long=1000; // bars to be counted (-1 - all the bars)
//---- indicator buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(2, ExtMapBuffer3);
SetIndexStyle(2, DRAW_LINE);
return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
Comment("");
return(0);
}

int start()
{
int cnt=0; // ń÷ĺň÷čę áŕđîâ
int begin_bar=0; // áŕđ, ń ęîňîđîăî íŕ÷číŕĺň đŕáîňó číäčęŕňîđ
int prev_day, cur_day; // čäĺíňčôčęŕňîđű ňĺęóůĺăî č ďđĺäűäóůĺăî äí˙
double day_high=0; // äíĺâíîé high
double day_low=0; // äíĺâíîé low
double yesterday_high=0; // íŕčáîëüřŕ˙ öĺíŕ ďđĺäűäóůĺăî äí˙
double yesterday_low=0; // íŕčěĺíüřŕ˙ öĺíŕ ďđĺäűäóůĺăî äí˙
double yesterday_close=0; // öĺíŕ çŕęđűňč˙ ďđĺäűäóůĺăî äí˙
double P, S, R;

// ďđŕâčëüíűĺ ňŕéěôđĺěű äë˙ íŕřĺăî číäčęŕňîđŕ - âńĺ, ÷ňî ěĺíüřĺ D1
if (Period() >= PERIOD_D1) {
Comment("WARNING: Invalid timeframe! Valid value < D1.");
return(0);
}

// đĺřŕĺě ń ęŕęîăî áŕđŕ ěű íŕ÷íĺě ń÷čňŕňü íŕř číäčęŕňîđ
if (how_long == -1) {
begin_bar = Bars;
} else {
begin_bar = how_long;
}

// îáőîäčě áŕđű ńëĺâŕ íŕďđŕâî (0-é áŕđ ňîćĺ čńďîëüçóĺě, ň.ę. čç íĺăî ěű áĺđ¸ě ňîëüęî high č low)
for (cnt = begin_bar; cnt >= 0; cnt--) {
cur_day = TimeDay(Time[cnt]);
if (prev_day != cur_day) {
yesterday_close = Close[cnt+1];
yesterday_high = day_high;
yesterday_low = day_low;
P = (yesterday_high + yesterday_low ) / 2;
R = yesterday_high;
S = yesterday_low;

// ň.ę. íŕ÷ŕëń˙ íîâűé äĺíü, ňî číčöččđóĺě ěŕęń. č ěčí. ňĺęóůĺăî (óćĺ) äí˙
day_high = High[cnt];
day_low = Low[cnt];

// çŕďîěíčě äŕííűé äĺíü, ęŕę ňĺęóůčé
prev_day = cur_day;
}

// ďđîäîëćŕĺě íŕęŕďëčâŕňü äŕííűĺ
day_high = MathMax(day_high, High[cnt]);
day_low = MathMin(day_low, Low[cnt]);

// đčńóĺě pivot-ëčíčţ ďî çíŕ÷ĺíčţ, âű÷čńëĺííîěó ďî ďŕđŕěĺňđŕě â÷ĺđŕříĺăî äí˙
ExtMapBuffer2[cnt] = P;
// đčńóĺě ëčíčč ńîďđîňčâëĺíč˙ č ďîääĺđćęč óđîâí˙ 1,2 čëč 3
ExtMapBuffer1[cnt] = R; // ńîďđîňčâëĺíčĺ
ExtMapBuffer3[cnt] = S; // ďîääĺđćęŕ
}

if (show_comment == 1) {
P = (yesterday_high + yesterday_low ) / 2;
R = yesterday_high;
S = yesterday_low;

Comment("Current H=", R, ", L=", S, ", HL/2=", P, ", H-L=", (R-S)/Point );
}
return(0);
}
//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 01-29-2007, 12:19 AM
Linuxser's Avatar
User Root
 
Join Date: May 2006
Location: Helliconia (Winter)
Posts: 4,410
Blog Entries: 56
Linuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond repute
Maybe this?

http://www.forex-tsd.com/81580-post3.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 01-29-2007, 11:16 AM
Junior Member
 
Join Date: Nov 2006
Posts: 7
iwan is on a distinguished road
Thanks a lot. I have changed parameters and this indicator draws yesterdays H and L on todays chart.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 01-30-2007, 08:22 AM
Gollum's Avatar
Junior Member
 
Join Date: Jan 2007
Location: Middle Earth
Posts: 1
Gollum is on a distinguished road
Hl

Hi guys... I'm a newbie here. i've been using the Previous day High & Low for a few months now and i think it works well. but can someone help me to make an indicator of Previous day High, Low, Close, Average High & Low of the previous day. Highly appreciated... May the Pips grow upon u....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Daily Direction......... ValeoFX General Discussion 4 05-25-2008 06:31 PM
Different timeframes for daily EA rjay Metatrader 4 3 12-29-2006 05:16 PM
Daily Profit cardio Setup Questions 1 09-03-2006 11:39 AM
MT4 and daily pivots. mike4X Setup Questions 2 05-27-2006 03:28 AM


All times are GMT. The time now is 12:09 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.