//+------------------------------------------------------------------+
//| Numerical Sequence Vibrations. A study in the reoccuring         |
//| frequency at which the currency market moves in vibrations       |                
//| that can be predicted mathmaticaly using standard division,      |
//| such as being divisible by the number 30. Such as                | 
//| 30, 60, 90, 120, etc.                                            |
//|                                                                  |                                                               |
//| This NSV idea is based on observation that the currency          |
//| more closely matches standard division % (such as 25%)           |
//| rather than Fibonacci sequence number % (such as 21.6).          |
//+------------------------------------------------------------------+
//| asys_beats_TRO_MODIFIED_VERSION                                  |
//| MODIFIED BY AVERY T. HORTON, JR. AKA THERUMPLEDONE@GMAIL.COM     |
//| I am NOT the ORIGINAL author 
//  and I am not claiming authorship of this indicator. 
//  All I did was modify it. I hope you find my modifications useful.|
//|                                                                  |
//+------------------------------------------------------------------+

#property copyright "Thom Lester and the Numerical Sequence Vibration of currency studies"
#property link      "Original study by Jared F. Martinez of :"
#property link      "Market Traders Institue under tittle of Hamrmonic Beats"
#property indicator_chart_window

//+--------- TRO MODIFICATION ---------------------------------------+ 
extern color color00 = Blue ;
extern color color25 = DodgerBlue ;
extern color color50 = SteelBlue ; 
extern color color75 = LightBlue ;

///+----Begin code---------+

int duplications=100;
int nsvsetting=30;
int d,sbt;
double decimal, nsvset,  nsv, P, c, sb;
// double decimal, length, P,c,sb,tfl;

int init()
{
string sym=Symbol();
int d=Digits;

// +-----Decimal listing for popular currencies traded:

if (sym == "AUDCAD") decimal=0.0000;
if (sym == "AUDJPY") decimal=0.00;
if (sym == "AUDUSD") decimal=0.0000;
if (sym == "CADJPY") decimal=0.00;
if (sym == "CHFJPY") decimal=0.00;
if (sym == "EURAUD") decimal=0.0000;
if (sym == "EURCHF") decimal=0.0000;
if (sym == "EURGBP") decimal=0.0000;
if (sym == "EURJPY") decimal=0.00;
if (sym == "EURUSD") decimal=0.0000;
if (sym == "GBPCHF") decimal=0.0000;
if (sym == "GBPJPY") decimal=0.00;
if (sym == "GBPUSD") decimal=0.0000;
if (sym == "NZDJPY") decimal=0.00;
if (sym == "NZDUSD") decimal=0.0000;
if (sym == "USDCAD") decimal=0.0000;
if (sym == "USDCHF") decimal=0.0000;
if (sym == "USDJPY") decimal=0.00;

nsv=nsvsetting;
 if (d==4) nsvset=nsv/10000;
 if (d==2) nsvset=nsv/100;

   return(0);
}
  
// +-----Numerical Sequence percentages drawn on chart:

int deinit()
{
// for( i=0; i<iterations; i++)
for( d=0; d<duplications; d++)
{
ObjectDelete("NSV line 0% "+nsvsetting+" "+d);
ObjectDelete("NSV line 25% "+nsvsetting+" "+d);
ObjectDelete("NSV line 50% "+nsvsetting+" "+d);
ObjectDelete("NSV line 75% "+nsvsetting+" "+d);

}
   return(0);
  }

// +-----Numerical Sequence line settings [location, color & style] :

int start()
  {

c=Close[0];

sbt=(decimal-c)/nsvset;
sb= decimal-(sbt*nsvset);


P=sb-(nsvset*(duplications/2));
d=0;
for( d=0; d<duplications; d++)

// +-----code for drawing 0% shown as a Solid line on chart

{
if (ObjectFind("NSV line 0% "+nsvsetting+" "+d) != 0)
{
ObjectCreate("NSV line 0% "+nsvsetting+" "+d, OBJ_HLINE, 0, Time[0], P);
      ObjectSet("NSV line 0% "+nsvsetting+" "+d, OBJPROP_COLOR, color00);
      ObjectSet("NSV line 0% "+nsvsetting+" "+d, OBJPROP_STYLE, STYLE_DOT);     
}
else 
{
 ObjectMove("NSV line 0% "+nsvsetting+" "+d, 0,Time[0], P);
 
 }

// +-----code for drawing 25% shown as a Dash line on chart

if (ObjectFind("NSV line 25% "+nsvsetting+" "+d) != 0)

{ 
ObjectCreate("NSV line 25% "+nsvsetting+" "+d, OBJ_HLINE, 0, Time[0], P+(nsvset*0.25));
      ObjectSet("NSV line 25% "+nsvsetting+" "+d, OBJPROP_COLOR, color25);
      ObjectSet("NSV line 25% "+nsvsetting+" "+d, OBJPROP_STYLE, STYLE_DASH);
}
else
{
 ObjectMove("NSV line 25% "+nsvsetting+" "+d, 0,Time[0], P+(nsvset*0.25));
}

// +-----code for drawing 50% shown as a DashDot line on chart

if (ObjectFind("NSV line 50% "+nsvsetting+" "+d) != 0)
{ 
ObjectCreate("NSV line 50% "+nsvsetting+" "+d, OBJ_HLINE, 0, Time[0], P+(nsvset*0.5));
      ObjectSet("NSV line 50% "+nsvsetting+" "+d, OBJPROP_COLOR, color50);
      ObjectSet("NSV line 50% "+nsvsetting+" "+d, OBJPROP_STYLE, STYLE_DASHDOT);
}
else
{
 ObjectMove("NSV line 50% "+nsvsetting+" "+d, 0,Time[0], P+(nsvset*0.5));
} 

// +-----code for drawing 75% shown as a Dot line on chart

if (ObjectFind("NSV line 75% "+nsvsetting+" "+d) != 0)
{ 
ObjectCreate("NSV line 75% "+nsvsetting+" "+d, OBJ_HLINE, 0, Time[0], P+(nsvset*0.75));
      ObjectSet("NSV line 75% "+nsvsetting+" "+d, OBJPROP_COLOR, color75);
      ObjectSet("NSV line 75% "+nsvsetting+" "+d, OBJPROP_STYLE, STYLE_DASHDOTDOT);
}
else
{
 ObjectMove("NSV line 75% "+nsvsetting+" "+d, 0,Time[0], P+(nsvset*0.75));
}


    P=P+nsvset;
}
Comment("Accrete - Harmonic Beats");
            
   return(0);
  }
//+----End of Numerical Sequence Vibration code---------+