Author: Copyright � 2006
BarsC-O
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
BarsC-O
//+------------------------------------------------------------------+
//|                                                      BarsC-O.mq4 |
//|                                                                  |
//|                                                       Êâàíò      |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2006"
#property link      "Kvant"

#property indicator_chart_window
#property indicator_color1 Red
#property indicator_buffers 2
#property indicator_color2 Blue

//+------------------------------------------------------------------+
//| Common External variables                                        |
//+------------------------------------------------------------------+
extern int body         = 0;
//+------------------------------------------------------------------+
//| Special Convertion Functions                                     |
//+------------------------------------------------------------------+

int LastTradeTime;
double ExtHistoBuffer[];
double ExtHistoBuffer2[];

void SetLoopCount(int loops)
{
}

void SetIndexValue(int shift, double value)
{
  ExtHistoBuffer[shift] = value;
}

void SetIndexValue2(int shift, double value)
{
  ExtHistoBuffer2[shift] = value;
}

//+------------------------------------------------------------------+
//| End                                                              |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| Initialization                                                   |
//+------------------------------------------------------------------+

int init()
{
   SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID);
   SetIndexBuffer(0, ExtHistoBuffer);
   SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID);
   SetIndexBuffer(1, ExtHistoBuffer2);
   SetIndexArrow(1,233);
   SetIndexArrow(0,234);
   return(0);
}
int start()
{
//+------------------------------------------------------------------+
//| Local variables                                                  |
//+------------------------------------------------------------------+
int shift = 0;
double sell = 0;
double buy = 0;


SetLoopCount(0);
// loop from first bar to current bar (with shift=0)
for(shift=Bars-1;shift>=0 ;shift--){ 
	SetIndexValue(shift, 0);
	SetIndexValue2(shift, 0);
} 

for(shift=Bars-100;shift>=0 ;shift--){ 


if((Close[shift]<Open[shift]) && (Open[shift]-Close[shift]>body*Point)){
   sell=High[shift]+15*Point;buy=0.00001;}  else sell=0.00001;

if((Close[shift]>Open[shift]) && (Close[shift]-Open[shift]>body*Point)){
   buy=Low[shift]-15*Point;sell=0.00001;}  else buy=0.00001;
 
   SetIndexValue(shift,sell);SetIndexValue2(shift,buy);}   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 ---