Author: xbox forex
xb4a
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
2 Views
0 Downloads
0 Favorites
xb4a

#property copyright "xbox forex"
#property link      "http://community.strangled.net"

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

double g_ibuf_76[];
double g_ibuf_80[];
double g_ibuf_84[];
extern int XBMAPeriod = 34;

int init() {
   IndicatorBuffers(5);
   SetIndexBuffer(0, g_ibuf_76);
   SetIndexBuffer(1, g_ibuf_80);
   SetIndexBuffer(2, g_ibuf_84);
   SetIndexStyle(0, DRAW_LINE);
   SetIndexStyle(1, DRAW_LINE);
   return (0);
}

int start() {
   for (int li_4 = Bars - 10; li_4 >= 0; li_4--) g_ibuf_84[li_4] = iMA(NULL, 0, XBMAPeriod, 0, MODE_EMA, PRICE_CLOSE, li_4);
   for (int li_8 = Bars - 10; li_8 >= 0; li_8--) {
      g_ibuf_76[li_8] = g_ibuf_84[li_8];
      g_ibuf_80[li_8] = g_ibuf_84[li_8];
      if (g_ibuf_84[li_8] > g_ibuf_84[li_8 + 1]) {
         g_ibuf_76[li_8] = EMPTY_VALUE;
         g_ibuf_80[li_8 + 1] = g_ibuf_84[li_8 + 1];
      } else {
         if (g_ibuf_84[li_8] < g_ibuf_84[li_8 + 1]) {
            g_ibuf_80[li_8] = EMPTY_VALUE;
            g_ibuf_76[li_8 + 1] = g_ibuf_84[li_8 + 1];
         }
      }
   }
   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 ---