Convert MT4 uf2018

mikeytrader13

New member
Hi all, hope this indicator can be helpful to your trading journey. This was developed by an unknown coder in 2012 and according to the code it displays a histogram that changes between two colors and its job is to serve as an initial checkpoint that helps your algorithm.

X8yabx9.png


See code below;
Code:
//

#property copyright   ""
#property link        ""
#property description ""

#property indicator_separate_window
#property indicator_buffers 2
//------
#property indicator_color1  clrOrangeRed  //clrRed  //clrMagenta
#property indicator_color2  clrDodgerBlue  //clrLightCyan  //clrWhite  //clrLime
//------
#property indicator_width1  2
#property indicator_width2  2
//------
#property indicator_style1  STYLE_DOT
#property indicator_style2  STYLE_DOT
//------

extern int BarN = 1000;
extern int ZZPeriod = 54;
//string gs_84 = "2012.02.27";
//int gi_92 = 30;
double SELL[];
double BUY[];
bool gi_104;
bool gi_108;
//bool gi_112 = TRUE;

int init() {
//   gi_112 = TRUE;
   SetIndexStyle(0, DRAW_HISTOGRAM);  //, EMPTY, 3, OrangeRed);
   SetIndexBuffer(0, SELL);
   SetIndexStyle(1, DRAW_HISTOGRAM);  //, EMPTY, 3, DodgerBlue);
   SetIndexBuffer(1, BUY);
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   double low_44;
   double high_52;
   double lda_92[10000][3];
   //string ls_unused_96;
//   if (!gi_112) return (0);
/*
   if (gs_84 != "")
   {
      if (TimeCurrent() > StrToTime(gs_84) + 86400 * gi_92)
      {
         Alert("Your version is expired!");
         Comment("Your version is expired!");
         gi_112 = FALSE;
         return (0);
      }
   }
*/
   int ind_counted_8 = IndicatorCounted();
   int li_20 = 0;
   int li_16 = 0;
   int index_24 = 0;
   double high_60 = High[BarN];
   double low_68 = Low[BarN];
   int li_32 = BarN;
   int li_36 = BarN;
   for (int li_12 = BarN; li_12 >= 0; li_12--) {
      low_44 = 10000000;
      high_52 = -100000000;
      for (int li_28 = li_12 + ZZPeriod; li_28 >= li_12 + 1; li_28--) {
         if (Low[li_28] < low_44) low_44 = Low[li_28];
         if (High[li_28] > high_52) high_52 = High[li_28];
      }
      if (Low[li_12] < low_44 && High[li_12] > high_52) {
         li_16 = 2;
         if (li_20 == 1) li_32 = li_12 + 1;
         if (li_20 == -1) li_36 = li_12 + 1;
      } else {
         if (Low[li_12] < low_44) li_16 = -1;
         if (High[li_12] > high_52) li_16 = 1;
      }
      if (li_16 != li_20 && li_20 != 0) {
         if (li_16 == 2) {
            li_16 = -li_20;
            high_60 = High[li_12];
            low_68 = Low[li_12];
            gi_104 = FALSE;
            gi_108 = FALSE;
         }
         index_24++;
         if (li_16 == 1) {
            lda_92[index_24][1] = li_36;
            lda_92[index_24][2] = low_68;
            gi_104 = FALSE;
            gi_108 = TRUE;
         }
         if (li_16 == -1) {
            lda_92[index_24][1] = li_32;
            lda_92[index_24][2] = high_60;
            gi_104 = TRUE;
            gi_108 = FALSE;
         }
         high_60 = High[li_12];
         low_68 = Low[li_12];
      }
      if (li_16 == 1) {
         if (High[li_12] >= high_60) {
            high_60 = High[li_12];
            li_32 = li_12;
         }
      }
      if (li_16 == -1) {
         if (Low[li_12] <= low_68) {
            low_68 = Low[li_12];
            li_36 = li_12;
         }
      }
      li_20 = li_16;
      if (gi_108 == TRUE) {
         BUY[li_12] = 1;
         SELL[li_12] = 0;
      }
      if (gi_104 == TRUE) {
         BUY[li_12] = 0;
         SELL[li_12] = 1;
      }
   }
   return (0);
}
Thank you.
 

halcyonguy

Well-known member
VIP
Lifetime
Hi all, hope this indicator can be helpful to your trading journey. This was developed by an unknown coder in 2012 and according to the code it displays a histogram that changes between two colors and its job is to serve as an initial checkpoint that helps your algorithm.

X8yabx9.png


See code below;
Code:
//

#property copyright   ""
#property link        ""
#property description ""

#property indicator_separate_window
#property indicator_buffers 2
//------
#property indicator_color1  clrOrangeRed  //clrRed  //clrMagenta
#property indicator_color2  clrDodgerBlue  //clrLightCyan  //clrWhite  //clrLime
//------
#property indicator_width1  2
#property indicator_width2  2
//------
#property indicator_style1  STYLE_DOT
#property indicator_style2  STYLE_DOT
//------

extern int BarN = 1000;
extern int ZZPeriod = 54;
//string gs_84 = "2012.02.27";
//int gi_92 = 30;
double SELL[];
double BUY[];
bool gi_104;
bool gi_108;
//bool gi_112 = TRUE;

int init() {
//   gi_112 = TRUE;
   SetIndexStyle(0, DRAW_HISTOGRAM);  //, EMPTY, 3, OrangeRed);
   SetIndexBuffer(0, SELL);
   SetIndexStyle(1, DRAW_HISTOGRAM);  //, EMPTY, 3, DodgerBlue);
   SetIndexBuffer(1, BUY);
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   double low_44;
   double high_52;
   double lda_92[10000][3];
   //string ls_unused_96;
//   if (!gi_112) return (0);
/*
   if (gs_84 != "")
   {
      if (TimeCurrent() > StrToTime(gs_84) + 86400 * gi_92)
      {
         Alert("Your version is expired!");
         Comment("Your version is expired!");
         gi_112 = FALSE;
         return (0);
      }
   }
*/
   int ind_counted_8 = IndicatorCounted();
   int li_20 = 0;
   int li_16 = 0;
   int index_24 = 0;
   double high_60 = High[BarN];
   double low_68 = Low[BarN];
   int li_32 = BarN;
   int li_36 = BarN;
   for (int li_12 = BarN; li_12 >= 0; li_12--) {
      low_44 = 10000000;
      high_52 = -100000000;
      for (int li_28 = li_12 + ZZPeriod; li_28 >= li_12 + 1; li_28--) {
         if (Low[li_28] < low_44) low_44 = Low[li_28];
         if (High[li_28] > high_52) high_52 = High[li_28];
      }
      if (Low[li_12] < low_44 && High[li_12] > high_52) {
         li_16 = 2;
         if (li_20 == 1) li_32 = li_12 + 1;
         if (li_20 == -1) li_36 = li_12 + 1;
      } else {
         if (Low[li_12] < low_44) li_16 = -1;
         if (High[li_12] > high_52) li_16 = 1;
      }
      if (li_16 != li_20 && li_20 != 0) {
         if (li_16 == 2) {
            li_16 = -li_20;
            high_60 = High[li_12];
            low_68 = Low[li_12];
            gi_104 = FALSE;
            gi_108 = FALSE;
         }
         index_24++;
         if (li_16 == 1) {
            lda_92[index_24][1] = li_36;
            lda_92[index_24][2] = low_68;
            gi_104 = FALSE;
            gi_108 = TRUE;
         }
         if (li_16 == -1) {
            lda_92[index_24][1] = li_32;
            lda_92[index_24][2] = high_60;
            gi_104 = TRUE;
            gi_108 = FALSE;
         }
         high_60 = High[li_12];
         low_68 = Low[li_12];
      }
      if (li_16 == 1) {
         if (High[li_12] >= high_60) {
            high_60 = High[li_12];
            li_32 = li_12;
         }
      }
      if (li_16 == -1) {
         if (Low[li_12] <= low_68) {
            low_68 = Low[li_12];
            li_36 = li_12;
         }
      }
      li_20 = li_16;
      if (gi_108 == TRUE) {
         BUY[li_12] = 1;
         SELL[li_12] = 0;
      }
      if (gi_104 == TRUE) {
         BUY[li_12] = 0;
         SELL[li_12] = 1;
      }
   }
   return (0);
}
Thank you.

generally when 2 colors are used , they line up with price moving up or down. the 2nd half of the chart has price dropping, and it lines up with a red section.
but in the first half of the chart, the colors don't line up at all with price movements.
i see no reason to use this.

you gave no description of what the code is looking for.
you didn't provide a link to the source, which may explain it.
 

mikeytrader13

New member
generally when 2 colors are used , they line up with price moving up or down. the 2nd half of the chart has price dropping, and it lines up with a red section.
but in the first half of the chart, the colors don't line up at all with price movements.
i see no reason to use this.

you gave no description of what the code is looking for.
you didn't provide a link to the source, which may explain it.
sorry did not find in depth explanation for this indicator and I thought the code could be understood. have two sources with basic information about it https://stonehillforex.com/2022/11/uf2018-as-a-confirmation-indicator/ and https://www.forexracer.com/uf2018-indicator-mt4/ thank you for your help.
 

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Top