Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 03:15:42 +0000



Post From: Volume spike coding

[2013-07-01 05:36:18]
user85017 - Posts: 37
Hello thanks for your code but in fact, i would like this code as a studie (see pictures) i find the same scipt for ninja so i don't know if it's possible for sierra

thanks

ninja script :

protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
      
//HIGH VOLUME SPIKE LONG SIGNAL
      if (CurrentBar > period)
      {
        if ( (Low[0]<=Low[1]) && (Low[0]<=Low[2]) &&
          (Close[0]>=Close[1]) && (Close[0]>=Open[0]) &&
          (Close[0]-Open[0])<(High[0]-Low[0]) &&
          //(Volume[1]>Volume[2]) && (Volume[1]>Volume[3]) && (Volume[1]>Volume[4]) && (Volume[1]>Volume[5]) && (Volume[1]>Volume[6]) )
          (Volume[1]>MAX(Volume,period)[2]) )
        {
          BackColor = Color.Green;
          //Spike.Set(1);
  
        }
        if ( (Low[0]>=Low[1]) && (Low[0]<=Low[2]) &&
          (Close[0]>=Close[1]) && (Close[0]>=Open[0]) &&
          ((Close[0]-Open[0])<(High[0]-Low[0])) &&
          //(Volume[1]>Volume[2]) && (Volume[1]>Volume[3]) && (Volume[1]>Volume[4]) && (Volume[1]>Volume[5]) && (Volume[1]>Volume[6]) )
          (Volume[1]>MAX(Volume,period)[2]) )
        {
          BackColor = Color.Lime;
          //Spike.Set(1);
  
        }
        
        
//HIGH VOLUME SPIKE SHORT SIGNAL
        if( (High[0]>=High[1]) && (High[0]>=High[2]) &&
          (Close[0]<=Close[1]) && (Close[0]<=Open[0]) &&
          ((Open[0]-Close[0])<(High[0]-Low[0])) &&
          //(Volume[1]>Volume[2]) && (Volume[1]>Volume[3]) && (Volume[1]>Volume[4]) && (Volume[1]>Volume[5]) && (Volume[1]>Volume[6]) )
          (Volume[1]>MAX(Volume,period)[2]) )
        {
          BackColor = Color.Crimson;
          //Spike.Set(-1);
        }
        
        if( (High[0]<=High[1]) && (High[0]>=High[2]) &&
          (Close[0]<=Close[1]) && (Close[0]<=Open[0]) &&
          ((Open[0]-Close[0])<(High[0]-Low[0])) &&
          //(Volume[1]>Volume[2]) && (Volume[1]>Volume[3]) && (Volume[1]>Volume[4]) && (Volume[1]>Volume[5]) && (Volume[1]>Volume[6]) )
          (Volume[1]>MAX(Volume,period)[2]) )
        {
          BackColor = Color.Red;
          //Spike.Set(-1);
        }        

      }  
      
      
}
imageninja.JPG / V - Attached On 2013-07-01 05:36:13 UTC - Size: 78.04 KB - 767 views