Forex



Go Back   Forex Trading > Downloads > Indicators - Metatrader 4
Forex Forum Register More recent 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 03-08-2006, 01:49 PM
Junior Member
 
Join Date: Feb 2006
Posts: 21
Qbert006 is on a distinguished road
Wiseman1 indicator....

Here is the code for an indicator that helps find divergent candles. Turns the Bullish ones Gree and the Bear ones Red. However, its for MT3. Could I just put it in to MT4 and Compile it? Dont want to try cause it might cause a glitch in my platform. So I thought I better ask first.

/*[[
Name := Wiseman 1
Author := David Thomas, Basileus@Moneytec
Notes := Bill Williams Wiseman 1 Divergent bars. ver. 3.
Notes := the changes of Basileus@Moneytec have been corrected and simplified.
Separate Window := No
First Color := LimeGreen
First Draw Type := Histogram
First Symbol := 217
Use Second Data := Yes
Second Color := Red
Second Draw Type := Histogram
Second Symbol := 218
]]*/
Variables : shift(0), prevbars(0), first(True), lips(0), teeth(0), loopbegin(0), median(0), jaws(0), result(0);
SetLoopCount(0);
// check conditions are ok.
if Bars < 3 Or Bars = prevbars then exit;
// check for additional bars loading or total reloading
If Bars < prevbars or Bars-prevbars>1 Then first = True;
prevbars = Bars;

If first Then Begin
// loopbegin prevent counting of counted bars exclude current
loopbegin = Bars-2;
first = False;
End;
// loop from first bar to current bar (with shift=0)
For shift=Bars-5 Downto 0 Begin
result = 0;
median = (H[shift]+L[shift])/2;
lips = iAlligator(13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, shift);
teeth = iAlligator(13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, shift);
jaws = iAlligator(13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, shift);

// test for bullish divergent bar:
if ((C[shift] >= median) // close is in lower half of bar
and (H[shift] < Min(Min(lips,teeth),jaws)) // bar is completely below alligator
and (L[shift] < L[shift+1]) and (L[shift] < L[shift+2]) // low is moving down
and (L[shift] < L[shift+3]) and (L[shift] < L[shift+4]) // ...
and (iAO(shift) < iAO(shift+1)) // checking if it's right AO signal
) then result = 1;

// test for bearish divergent bar:
if ((C[shift] <= median) // close is upper half of bar
and (L[shift] > Max(Max(lips,teeth),jaws)) // bar is completely above alligator
and (H[shift] > H[shift+1]) and (H[shift] > H[shift+2]) // high is moving up
and (H[shift] > H[shift+3]) and (H[shift] > H[shift+4]) // ...
and (iAO(shift) > iAO(shift+1)) // checking if it's right AO signal
) then result = -1;

if result < 0 then
{
// red bar.
SetIndexValue(shift, Low[shift]);
SetIndexValue2(shift, High[shift]);
}
if result > 0 then
{
// green bar.
SetIndexValue(shift, High[shift]);
SetIndexValue2(shift, Low[shift]);
}
End;

Last edited by Qbert006; 03-08-2006 at 01:53 PM.
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 03-08-2006, 02:18 PM
Senior Member
 
Join Date: Jan 2006
Posts: 272
haubentaucher is on a distinguished road
This is what I have:




//+------------------------------------------------------------------+
//| BW-wiseMan-1.mq4 |
//| Copyright © 2005, wellx |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, wellx"
#property link "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Yellow
#property indicator_color2 OrangeRed

extern int updown=5; //смещение индикатора чтобы не налезална другие значки
extern int back=2; // кол-во баров для анализа назад



//---- buffers
double BWWM1Up[];
double BWWM1Down[];

int pos=0;
int i=0;
bool contup=true,contdown=true;


//+-----------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,140);
SetIndexBuffer(0,BWWM1Up);
SetIndexEmptyValue(0,0.0);

SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,140);
SetIndexBuffer(1,BWWM1Down);
SetIndexEmptyValue(1,0.0);

IndicatorDigits(6);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int cbars=IndicatorCounted();
if (cbars<0) return(-1);
if (cbars>0) cbars--;
//---- TODO: add your code here
//if (cbars == 0) return(0);
pos=cbars;
while (pos > 0)
{
BWWM1Up[pos]=NULL;
BWWM1Down[pos]=NULL;

if (
(Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, pos))
&&
(Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, pos))
&&
(Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, pos))
&&
(Close[pos]<((High[pos]+Low[pos])/2))
)
{
contup=true;
for(i=1; i <= back ;i++)
{
if (High[pos]<=High[pos+i])
{
contup=false;
break;
}
}
if (contup) BWWM1Up[pos]=(High[pos]+updown*Point);
}


if (
(High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, pos))
&&
(High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, pos))
&&
(High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, pos))
&&
(Close[pos]>((High[pos]+Low[pos])/2))
)
{
contdown=true;
for(i=1; i <= back ;i++)
{
if (Low[pos]>=Low[pos+i])
{
contdown=false;
break;
}
}
if (contdown) BWWM1Down[pos]=(Low[pos]-updown*Point);
}

pos--;
}

//----
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
  #3 (permalink)  
Old 03-08-2006, 04:10 PM
Junior Member
 
Join Date: Feb 2006
Posts: 21
Qbert006 is on a distinguished road
Thanx Bro! Works great!
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 03-08-2006, 04:46 PM
Senior Member
 
Join Date: Jan 2006
Posts: 272
haubentaucher is on a distinguished road
Quote:
Originally Posted by Qbert006
Thanx Bro! Works great!
Thanx!

wiseman 2:


//+------------------------------------------------------------------+
//| wlxBWWiseMan-2.mq4 |
//| Copyright © 2005, wellx |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, wellx"
#property link "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkOrange
#property indicator_color2 Magenta

//---- input parameters

extern int updown=8;
//---- buffers
double BWWM2Up[];
double BWWM2Down[];

int pos=0;
double AO,AO1,AO2,AO3,AO4;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,141);
SetIndexBuffer(0,BWWM2Up);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,141);
SetIndexBuffer(1,BWWM2Down);
SetIndexEmptyValue(1,0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int cbars=IndicatorCounted();
if (cbars<0) return(-1);
if (cbars>0) cbars--;
//---- TODO: add your code here
if (cbars > (Bars-40)) pos=(Bars-40);
else pos=cbars;
//----
while (pos > 0)
{
BWWM2Up[pos]=NULL;
BWWM2Down[pos]=NULL;
AO=iAO(NULL,0,pos);
AO1=iAO(NULL,0,pos+1);
AO2=iAO(NULL,0,pos+2);
AO3=iAO(NULL,0,pos+3);
AO4=iAO(NULL,0,pos+4);

if (
(AO4>0.0 && AO3>0.0 )
&&
(AO4<AO3 && AO3>AO2 && AO2>AO1 && AO1>AO)
)
BWWM2Up[pos]=(High[pos]+updown*Point);

if (
(AO4<0.0 && AO3<0.0 )
&&
(AO4>AO3 && AO3<AO2 && AO2<AO1 && AO1<AO)
)
BWWM2Down[pos]=(Low[pos]-updown*Point);
pos--;
}


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
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


All times are GMT. The time now is 09:05 PM.



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