//***Read this first: Integration with Molanis Strategy Builder***
/*To integrate this indicator with Molanis Strategy Builder use the following modes:
Mode 0 = (Close[i]-Low[i]);
*/

//+-------------------------------------------------------------------------------------+
//                      DO NOT DELETE THIS HEADER
//             DELETING THIS HEADER IS COPYRIGHT INFRIGMENT 
//                      Copyright © 2009, Molanis
//                   Molanis Technical Indicator Builder 3.1 
//                       http://www.molanis.com                      
//                    
// THIS TECHNICAL INDICATOR CODE HAS BEEN GENERATED USING MOLANIS TECHNICAL INDICATOR BUILDER 3.1 
// on Thu Dec 12 15:56:32 CET 2013 
// Disclaimer: This TECHNICAL INDICATOR is provided to you "AS-IS", and Molanis disclaims any warranty
// or liability obligations to you of any kind. 
// UNDER NO CIRCUMSTANCES WILL MOLANIS BE LIABLE TO YOU, OR ANY OTHER PERSON OR ENTITY,
// FOR ANY LOSS OF USE, REVENUE OR PROFIT, LOST OR DAMAGED DATA, OR OTHER COMMERCIAL OR
// ECONOMIC LOSS OR FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, STATUTORY, PUNITIVE,
// EXEMPLARY OR CONSEQUENTIAL DAMAGES WHATSOEVER RELATED TO YOUR USE OF THIS TECHNICAL INDICATOR OR 
// MOLANIS TECHNICAL INDICATOR BUILDER     
// Because software is inherently complex and may not be completely free of errors, you are 
// advised to verify this TECHNICAL INDICATOR. 
// Before using this TECHNICAL INDICATOR, please read the Molanis Technical Indicator Builder
// license for a complete understanding of Molanis' disclaimers.  
// USE THIS TECHNICAL INDICATOR AT YOUR OWN RISK. 
//  
//                      DO NOT DELETE THIS HEADER
//             DELETING THIS HEADER IS COPYRIGHT INFRIGMENT 
//+-------------------------------------------------------------------------------------+


//+------------------------------------------------------------------+
//| Indicator Notes                                                  |
/*| */
//+------------------------------------------------------------------+

//Technical Indicator Comments
#property copyright "Copyright © 2009, Molanis V 3.1 Beta"
#property link      "http://www.molanis.com" 


#property indicator_chart_window     //show the indicator in the chart window 
#property indicator_buffers 1

//the color for displaying line N, where N lies between 1 and 8
#property indicator_color1 Red
               

string    indName="bmup01";                     // Indicator Name
//---- buffers
double ExtMapBuffer0[];


//--- Zero Divide Fix
int FixZeroD=0;

//+------------------------------------------------------------------+
//                      DO NOT DELETE THIS HEADER
//             DELETING THIS HEADER IS COPYRIGHT INFRIGMENT 
//                      Copyright © 2009, Molanis
//                   Molanis Technical Indicator Builder 3.1 
//                       http://www.molanis.com 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators setup

SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);

SetIndexBuffer(0,ExtMapBuffer0);



IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));	   
   
	
	Print("M-*** Technical Indicator ",indName," created with Molanis Technical Indicator Builder 3.1 *** ");  
    Print("M-*** Technical Indicator ",indName," starts running at: Server Time=",TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS)," Terminal Time=",TimeToStr(TimeLocal(),TIME_DATE|TIME_SECONDS)); 
    Comment("THIS CUSTOM INDICATOR HAS BEEN GENERATED BY MOLANIS TECHNICAL INDICATOR BUILDER 3.1 - www.MOLANIS.com");
   //----
   return(0);
  } 

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   Comment("");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//                      DO NOT DELETE THIS HEADER
//             DELETING THIS HEADER IS COPYRIGHT INFRIGMENT 
//                      Copyright © 2009, Molanis
//                   Molanis Technical Indicator Builder 3.1 
//                       http://www.molanis.com 
//+------------------------------------------------------------------+
//| Start function has the Indicator Calculations                    |
//+------------------------------------------------------------------+
  
  //--------------------------------------------------------------------
int start()                         
  {
   int i,Counted_bars;                 

//--------------------------------------------------------------------

   Counted_bars=IndicatorCounted();  
   i=Bars-Counted_bars-1; 
   if(Counted_bars == 0) 
       i = Bars -1 -FixZeroD; 
   double sum=0;
              
   while(i>=0)                      
     {
      //Main Calculation;
      ExtMapBuffer0[i]=(Close[i]-Low[i]);
  
                 
                    
      i--;                          
     }
//--------------------------------------------------------------------
   return;                          
  }
//--------------------------------------------------------------------
