$ROLLING_RANGE

Author: Avery T. Horton, Jr. aka TheRumpledOne � 2008
$ROLLING_RANGE
Price Data Components
Series array that contains close prices for each barSeries array that contains open prices of each bar
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
$ROLLING_RANGE

//+------------------------------------------------------------------+ 
//|   $ROLLING_RANGE                                                 | 
//|                                                                  | 
//|                                                                  | 
//|   Copyright © 2008, Avery T. Horton, Jr. aka TheRumpledOne       |
//|                                                                  |
//|   PO BOX 43575, TUCSON, AZ 85733                                 |
//|                                                                  |
//|   GIFT AND DONATIONS ACCEPTED                                    | 
//|                                                                  |
//|   therumpldone@gmail.com                                         |  
//+------------------------------------------------------------------+ 
//|                                                                  |
//| go to www.kreslik.com for the latest indicator updates           |  
//+------------------------------------------------------------------+ 
//|                                                                  |
//| Use www.efxgroup.com as your forex broker...                     |  
//| ...tell them therumpledone sent you!                             |  
//+------------------------------------------------------------------+ 


#property copyright "Avery T. Horton, Jr. aka TheRumpledOne © 2008" 

#property link      "www.kreslik.com" 

#property indicator_chart_window

#property indicator_buffers 1
#property indicator_color1 White  

//---- input parameters 

//extern int myPeriod   = 5 ;
extern int myBarsAgo  = 5 ;

//---- buffers

double _Value[];

double   cClose, pOpen, xDiff;

//+------------------------------------------------------------------+ 
//| Custom indicator initialization function                         | 
//+------------------------------------------------------------------+ 
int init() 
  { 
   IndicatorBuffers(1);
   SetIndexBuffer(0,_Value);  
   SetIndexStyle(0,DRAW_LINE);  
   return(0); 
  } 
//+------------------------------------------------------------------+ 
//| Custom indicator deinitialization function                       | 
//+------------------------------------------------------------------+ 
int deinit() 
  { 
//---- 
    
//---- 
   return(0); 
  } 
//+------------------------------------------------------------------+ 
//| Custom indicator iteration function                              | 
//+------------------------------------------------------------------+ 


int start() 
{ 

cClose = iClose(NULL,0,0) ;
pOpen  = iOpen(NULL,0,myBarsAgo) ;

xDiff  = (cClose - pOpen) / Point ;

/* 
    if ( xDiff > myBarsAgo   ) _Value[0] = 1;     else {
    if ( xDiff < myBarsAgo  )  _Value[0] = -1;    else  _Value[0] = 0;  }
*/
  _Value[0] = xDiff;  
    
   return( 0 ); 
} 
//+------------------------------------------------------------------+ 


Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---