log in     sign up for free
 
I had to learn discipline and money management. I decided that I was going to become very disciplined and businesslike about my trading.
Paul Tudor Jones
 
 
Home
systems (285)
 
 
Special offer: buy MetaStock (try for free)   |   Reuters QuoteCenter Real-Time Data (get a free month)   |   EOD Data
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

3 Line Break

Formula for: MetaTrader

mql4 indicator

 

 

Views:  2693

Added: September 22, 2008
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: MetaTrader, mql4 indicator
 




Code:

//+------------------------------------------------------------------+
//| 3LineBreak.mq4 |
//| Copyright © 2004, Poul_Trade_Forum |
//| Aborigen |
//| http://forex.kbpauk.ru/ |
//+------------------------------------------------------------------+
#property copyright "Poul Trade Forum"
#property link "http://forex.kbpauk.ru/"
#property indicator_chart_window
#property indicator_buffers 2

//---- input parameters
extern int Lines_Break=3;
//---- buffers
double HighBuffer[];
double LowBuffer[];
double VALUE1,VALUE2,Swing=1,OLDSwing;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,2,Blue);
SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,2,Red);

SetIndexBuffer(0,HighBuffer);
SetIndexBuffer(1,LowBuffer);

SetIndexEmptyValue(0,0);
SetIndexEmptyValue(1,0);

//---- name for DataWindow and indicator subwindow label
short_name="3LineBreak";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);

//----
SetIndexDrawBegin(0,10);
SetIndexDrawBegin(1,10);
//----

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

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted(),i,shift;


//---- TODO: add your code here
if (counted_bars==0) counted_bars=Lines_Break+1;
i=(Bars-counted_bars);

for (shift=i; shift>=0;shift--)
{

OLDSwing=Swing;

VALUE1=High[Highest(NULL,0,MODE_HIGH,Lines_Break,shift+1)];
VALUE2= Low[Lowest(NULL,0,MODE_LOW,Lines_Break,shift+1)];
if (OLDSwing==1 && Low[shift] if (OLDSwing==-1 && High[shift]>VALUE1 ) Swing=1;

if (Swing==1)
{ HighBuffer[shift]=High[shift]; LowBuffer[shift]=Low[shift]; }

if (Swing==-1)
{ LowBuffer[shift]=High[shift]; HighBuffer[shift]=Low[shift]; }


//----
}
return(0);
}
//+------------------------------------------------------------------+

 





Code to difficult? Find somebody to help you with coding here.

 



Author: Aborigen

 

View similar (mql4 indicator for MetaTrader):

DS_Stochastic
ADX Crossing
Super-Signals
5dayBreakout
ATR Ratio
5_34_5
3D Oscilator
Inside or Outside Bars
Avg Daily Range
Inside Bar
...
 
 
all formulas for MetaTrader
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
PayPalSecure payments by PayPal S4T™ is a part of TAURO EDUCATION NETWORK
 
Privacy note | (c) copyrights systems4trading.com 2006-2009