///////////////////////////////////////////////////////////////////
//Generated by ex4 to mq4 decompile Service                      // 
//Website: www.decompile.ru                                      //
//E-mail : jlk2k3@gmail.com ; decompiler.ex4tomq4@gmail.com      //
///////////////////////////////////////////////////////////////////
#property copyright "Copyright 2013, Pimpmyea.com"
#property link      "http://www.pimpmyea.com"

#property indicator_chart_window
#property indicator_buffers 6


extern int spaghetti_fast_min = 3;
extern int spaghetti_fast_max = 15;
extern string note1 = "O=SMA, 1=EMA, 2=SMMA, 3=LWMA, 4=HULLMA";
extern int ma_method = 1;
extern string note2 = "O=C, 1=O, 2=H, 3=L, 4=MED, 5=TYP, 6=WEI";
extern int ma_price = 0;
extern color color_line = LightCoral;

double G_ibuf_108[];
double G_ibuf_112[];
double G_ibuf_116[];
double G_ibuf_120[];
double G_ibuf_124[];
double G_ibuf_128[];
int G_period_132 = 3;
int G_period_136 = 5;
int G_period_140 = 8;
int G_period_144 = 10;
int G_period_148 = 13;
int G_period_152 = 15;
double Gd_156 = 0.0;
bool Gi_164 = FALSE;

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   Comment("");
   string str_concat_0 = StringConcatenate("v", DoubleToStr(1.04, 2));
   Print("SpaghettiFX_Fast", " ", str_concat_0);
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 1,color_line);
   SetIndexBuffer(0, G_ibuf_108);
   SetIndexLabel(0, "Spaghetti_Fast_1");
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 1,color_line);
   SetIndexBuffer(1, G_ibuf_112);
   SetIndexLabel(1, "Spaghetti_Fast_2");
   SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 1,color_line);
   SetIndexBuffer(2, G_ibuf_116);
   SetIndexLabel(2, "Spaghetti_Fast_3");
   SetIndexStyle(3, DRAW_LINE, STYLE_SOLID, 1,color_line);
   SetIndexBuffer(3, G_ibuf_120);
   SetIndexLabel(3, "Spaghetti_Fast_4");
   SetIndexStyle(4, DRAW_LINE, STYLE_SOLID, 1,color_line);
   SetIndexBuffer(4, G_ibuf_124);
   SetIndexLabel(4, "Spaghetti_Fast_5");
   SetIndexStyle(5, DRAW_LINE, STYLE_SOLID, 1,color_line);
   SetIndexBuffer(5, G_ibuf_128);
   SetIndexLabel(5, "Spaghetti_Fast_6");
   f0_0();
   f0_1();
   return (0);
}
	 	  		 		  	 			  							 		   	 	  			  	 				   	 						   		  	 	 	 	 		  		  		 	     		 				 			 	 	    		    					 			 		  	 	 	  		   	  
// 3E6333C07FE2C2DF9A551FC98F38EFEB
void f0_0() {
   if (!GlobalVariableCheck("SPAGHETTIFX_GV_ENABLED")) GlobalVariableSet("SPAGHETTIFX_GV_ENABLED", 0);
   if (!GlobalVariableCheck("SPAGHETTIFX_FAST_MIN")) GlobalVariableSet("SPAGHETTIFX_FAST_MIN", 3);
   if (!GlobalVariableCheck("SPAGHETTIFX_FAST_MAX")) GlobalVariableSet("SPAGHETTIFX_FAST_MAX", 15);
   if (!GlobalVariableCheck("SPAGHETTIFX_SLOW_MIN")) GlobalVariableSet("SPAGHETTIFX_SLOW_MIN", 30);
   if (!GlobalVariableCheck("SPAGHETTIFX_SLOW_MAX")) GlobalVariableSet("SPAGHETTIFX_SLOW_MAX", 60);
   if (!GlobalVariableCheck("SPAGHETTIFX_MA_METHOD")) GlobalVariableSet("SPAGHETTIFX_MA_METHOD", 1);
   if (!GlobalVariableCheck("SPAGHETTIFX_MA_PRICE")) GlobalVariableSet("SPAGHETTIFX_MA_PRICE", 0);
   if (GlobalVariableGet("SPAGHETTIFX_GV_ENABLED") != 0.0) {
      if (spaghetti_fast_min != GlobalVariableGet("SPAGHETTIFX_FAST_MIN")) {
         spaghetti_fast_min = GlobalVariableGet("SPAGHETTIFX_FAST_MIN");
         Gi_164 = TRUE;
      }
      if (spaghetti_fast_max != GlobalVariableGet("SPAGHETTIFX_FAST_MAX")) {
         spaghetti_fast_max = GlobalVariableGet("SPAGHETTIFX_FAST_MAX");
         Gi_164 = TRUE;
      }
      if (ma_method != GlobalVariableGet("SPAGHETTIFX_MA_METHOD")) {
         ma_method = GlobalVariableGet("SPAGHETTIFX_MA_METHOD");
         Gi_164 = TRUE;
      }
      if (ma_price != GlobalVariableGet("SPAGHETTIFX_MA_PRICE")) {
         ma_price = GlobalVariableGet("SPAGHETTIFX_MA_PRICE");
         Gi_164 = TRUE;
      }
   }
}
	 	 	 	  	   			   	  		 	 	 	    	 	 			 	   			  		 		 		 					 	  		   							 			   	  	 			 	 	   			  					     		  		 				 	  		 			 			 	
// A145FAB7DCB557E6156225712E33F301
void f0_1() {
   G_period_132 = spaghetti_fast_min;
   G_period_152 = spaghetti_fast_max;
   Gd_156 = (G_period_152 - G_period_132) / 5.0;
   G_period_136 = MathRound(G_period_132 + Gd_156);
   G_period_140 = MathRound(G_period_132 + 2.0 * Gd_156);
   G_period_144 = MathRound(G_period_132 + 3.0 * Gd_156);
   G_period_148 = MathRound(G_period_132 + 4.0 * Gd_156);
   Print("period_1 = ", G_period_132);
   Print("period_2 = ", G_period_136);
   Print("period_3 = ", G_period_140);
   Print("period_4 = ", G_period_144);
   Print("period_5 = ", G_period_148);
   Print("period_6 = ", G_period_152);
}
	 	 			  	    		   	 			 	 	      	 					 	  				  					 		 	 			 	   	   			 			 				  	  	  		 	 	 	 			  	 			    			  		  			 	   	 			 	 	 	
// 52D46093050F38C27267BCE42543EF60
int deinit() {
   return (0);
}
	 	 	 	  	   			   	  		 	 	 	    	 	 			 	   			  		 		 		 					 	  		   							 			   	  	 			 	 	   			  					     		  		 				 	  		 			 			 	
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   f0_0();
   int Li_0 = IndicatorCounted();
   if (Gi_164) {
      f0_1();
      Li_0 = 1;
      Gi_164 = FALSE;
   }
   if (Li_0 < 0) return (-1);
   if (Li_0 > 0) Li_0--;
   int Li_4 = Bars - Li_0;
   for (int Li_8 = 0; Li_8 < Li_4; Li_8++) {
      if (ma_method < 4) {
         G_ibuf_108[Li_8] = iMA(NULL, 0, G_period_132, 0, ma_method, ma_price, Li_8);
         G_ibuf_112[Li_8] = iMA(NULL, 0, G_period_136, 0, ma_method, ma_price, Li_8);
         G_ibuf_116[Li_8] = iMA(NULL, 0, G_period_140, 0, ma_method, ma_price, Li_8);
         G_ibuf_120[Li_8] = iMA(NULL, 0, G_period_144, 0, ma_method, ma_price, Li_8);
         G_ibuf_124[Li_8] = iMA(NULL, 0, G_period_148, 0, ma_method, ma_price, Li_8);
         G_ibuf_128[Li_8] = iMA(NULL, 0, G_period_152, 0, ma_method, ma_price, Li_8);
      } else {
         G_ibuf_108[Li_8] = iCustom(NULL, 0, "HullMA", G_period_132, 0, 3, 0, Li_8);
         G_ibuf_112[Li_8] = iCustom(NULL, 0, "HullMA", G_period_136, 0, 3, 0, Li_8);
         G_ibuf_116[Li_8] = iCustom(NULL, 0, "HullMA", G_period_140, 0, 3, 0, Li_8);
         G_ibuf_120[Li_8] = iCustom(NULL, 0, "HullMA", G_period_144, 0, 3, 0, Li_8);
         G_ibuf_124[Li_8] = iCustom(NULL, 0, "HullMA", G_period_148, 0, 3, 0, Li_8);
         G_ibuf_128[Li_8] = iCustom(NULL, 0, "HullMA", G_period_152, 0, 3, 0, Li_8);
      }
   }
   return (0);
}