log in     sign up for free
 
The more disciplined you can get, the better you are going to do in the market. The more you listen to tips and rumors, the more money you're likely to lose.
David Ryan
 
 
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

ATR Ratio

Formula for: MetaTrader

mql4 indicator

 

 

Views:  1952

Added: February 04, 2007
 
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
 


Optimu stop losses.

 

 



Code:

//+------------------------------------------------------------------+
//| ATR ratio.mq4 |
//| Copyright © 2005, Luis Guilherme Damiani |
//| http://www.damianifx.com.br |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Luis Guilherme Damiani"
#property link "http://www.damianifx.com.br"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Silver
#property indicator_color2 Violet
//---- input parameters
extern int short_atr=7;
extern int long_atr=49;
extern double triglevel=1.00;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//Comment("ATR ratio= "+short_atr+" / "+long_atr);
for(int i=0;i<Bars-counted_bars;i++)
{
ExtMapBuffer1[i]=triglevel;
double sa=iATR(NULL,0,short_atr,i);
ExtMapBuffer2[i]= sa/iATR(NULL,0,long_atr,i);
}
//----

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


 





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

 



Author: Luis Guilherme Damiani http://www.damianifx.com.br
Source: http://www.forex-tsd.com

 

View similar (mql4 indicator for MetaTrader):

ATR Ratio
Chaikin's Volatility
ATR Channels
ATR
5_34_5
3D Oscilator
DS_Stochastic
ADX Crossing
5dayBreakout
ATR Levels
...
 
 
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