Author:
QQE Spec
Indicators Used
Relative strength indexMoving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
QQE Spec
//+------------------------------------------------------------------+
//|                                                     QQE Spec.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright ""
#property link      "http://www.forex-tsd.com/indicators-metatrader-4/18585-2-qqe-combined-anchored-need-help.html#post264993"

#property indicator_separate_window
#property indicator_levelcolor Black
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_width1 2
#property indicator_width2 2
#property indicator_level1 50.0

extern int SF = 1;
extern int RSI_Period = 8;
extern int WP = 3;
int g_period_88;
int gi_92;
double g_ibuf_96[];
double g_ibuf_100[];
double g_ibuf_104[];
double g_ibuf_108[];
double g_ibuf_112[];

int init() {
   g_period_88 = 2 * RSI_Period - 1;
   if (g_period_88 < SF) gi_92 = SF;
   else gi_92 = g_period_88;
   IndicatorBuffers(6);
   SetIndexBuffer(0, g_ibuf_112);
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
   SetIndexLabel(0, "Value 1");
   SetIndexDrawBegin(0, gi_92);
   SetIndexStyle(1, DRAW_LINE, STYLE_DOT);
   SetIndexBuffer(1, g_ibuf_96);
   SetIndexLabel(1, "Value 2");
   SetIndexDrawBegin(1, gi_92);
   SetIndexBuffer(2, g_ibuf_100);
   SetIndexBuffer(3, g_ibuf_104);
   SetIndexBuffer(4, g_ibuf_108);
   IndicatorShortName("QQE Spec");
   return (0);
}

int start() {
   double l_ima_on_arr_8;
   double ld_24;
   double ld_40;
   if (Bars <= gi_92) return (0);
   int li_0 = IndicatorCounted();
   if (li_0 < 1) {
      for (int li_4 = Bars - gi_92; li_4 < Bars; li_4++) {
         g_ibuf_96[li_4] = 0.0;
         g_ibuf_100[li_4] = 0.0;
         g_ibuf_104[li_4] = 0.0;
         g_ibuf_108[li_4] = 0.0;
         g_ibuf_112[li_4] = 0.0;
      }
   }
   li_0 = Bars - li_0 - 1;
   for (li_4 = li_0; li_4 >= 0; li_4--) g_ibuf_108[li_4] = iRSI(NULL, 0, RSI_Period, PRICE_CLOSE, li_4);
   for (li_4 = li_0; li_4 >= 0; li_4--) {
      g_ibuf_112[li_4] = iMAOnArray(g_ibuf_108, 0, SF, 0, MODE_EMA, li_4);
      g_ibuf_100[li_4] = MathAbs(g_ibuf_112[li_4 + 1] - g_ibuf_112[li_4]);
   }
   for (li_4 = li_0; li_4 >= 0; li_4--) g_ibuf_104[li_4] = iMAOnArray(g_ibuf_100, 0, g_period_88, 0, MODE_EMA, li_4);
   li_4 = li_0 + 1;
   double ld_32 = g_ibuf_96[li_4];
   for (double l_ima_on_arr_16 = iMAOnArray(g_ibuf_108, 0, SF, 0, MODE_EMA, li_4); li_4 > 0; l_ima_on_arr_16 = l_ima_on_arr_8) {
      li_4--;
      l_ima_on_arr_8 = iMAOnArray(g_ibuf_108, 0, SF, 0, MODE_EMA, li_4);
      ld_24 = iMAOnArray(g_ibuf_104, 0, g_period_88, 0, MODE_EMA, li_4) * WP;
      ld_40 = ld_32;
      if (l_ima_on_arr_8 < ld_32) {
         ld_32 = l_ima_on_arr_8 + ld_24;
         if (l_ima_on_arr_16 < ld_40)
            if (ld_32 > ld_40) ld_32 = ld_40;
      } else {
         if (l_ima_on_arr_8 > ld_32) {
            ld_32 = l_ima_on_arr_8 - ld_24;
            if (l_ima_on_arr_16 > ld_40)
               if (ld_32 < ld_40) ld_32 = ld_40;
         }
      }
      g_ibuf_96[li_4] = ld_32;
   }
   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 ---