PwR





#property copyright "Copyright © 2009, MoForce"
#property link      ""

#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Black
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Lime
#property indicator_color5 White

int g_period_76 = 3;
int gi_unused_80 = 26;
int g_period_84 = 144;
double g_ibuf_88[];
double g_ibuf_92[];
double g_ibuf_96[];
double g_ibuf_100[];
double g_ibuf_104[];

int init() {
   SetIndexStyle(0, DRAW_NONE);
   SetIndexStyle(1, DRAW_HISTOGRAM);
   SetIndexStyle(2, DRAW_HISTOGRAM);
   SetIndexStyle(3, DRAW_LINE);
   SetIndexStyle(4, DRAW_LINE);
   SetIndexDrawBegin(1, g_period_84);
   IndicatorDigits(Digits + 1);
   SetIndexBuffer(0, g_ibuf_104);
   SetIndexBuffer(1, g_ibuf_88);
   SetIndexBuffer(2, g_ibuf_92);
   SetIndexBuffer(3, g_ibuf_96);
   SetIndexBuffer(4, g_ibuf_100);
   IndicatorShortName("PwR");
   return (0);
}

int start() {
   int li_4 = IndicatorCounted();
   if (li_4 > 0) li_4--;
   int li_0 = Bars - li_4;
   for (int li_8 = 0; li_8 < li_0; li_8++) {
      if (iBullsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8) + iBearsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8) >= 0.0) {
         g_ibuf_88[li_8] = iBullsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8) + iBearsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8);
         g_ibuf_92[li_8] = 0;
         g_ibuf_104[li_8] = iBullsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8) + iBearsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8);
      } else {
         g_ibuf_88[li_8] = 0;
         g_ibuf_92[li_8] = iBullsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8) + iBearsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8);
         g_ibuf_104[li_8] = iBullsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8) + iBearsPower(NULL, 0, g_period_84, PRICE_CLOSE, li_8);
      }
   }
   for (li_8 = 0; li_8 < li_0; li_8++) {
      if (iMAOnArray(g_ibuf_104, Bars, g_period_76, 0, MODE_SMA, li_8) >= 0.0) g_ibuf_96[li_8] = iMAOnArray(g_ibuf_104, Bars, g_period_76, 0, MODE_SMA, li_8);
      else g_ibuf_100[li_8] = iMAOnArray(g_ibuf_104, Bars, g_period_76, 0, MODE_SMA, li_8);
   }
   return (0);
}



Sample





Analysis



Market Information Used:



Indicator Curves created:

Implements a curve of type DRAW_NONE
Implements a curve of type DRAW_HISTOGRAM
Implements a curve of type DRAW_LINE


Indicators Used:

Bears Power indicator
Bulls Power indicator
Moving average indicator


Custom Indicators Used:

Order Management characteristics:

Other Features: