Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 14:09:06 +0000



[User Discussion] - Volume spike coding

View Count: 2876

[2013-06-30 21:16:21]
user85017 - Posts: 37
Hello,

this is the indicator code called "High Volume Spike Reversal" for tradestation platform, do you think it's possible to have it for sierra

Vars:
iVolume(0);

If bartype < 2 then iVolume = Ticks else IVolume = volume;



//HIGH VOLUME SPIKE LONG SIGNAL

Condition1=Low<=Low[1] AND Low<=Low[2] AND Close>=Close[1] AND Close>=Open AND (Close-Open)<(High-Low) AND iVolume[1]>iVolume[2] AND iVolume[1]>iVolume[3] AND iVolume[1]>iVolume[4] AND iVolume[1]>iVolume[5] AND iVolume[1]>iVolume[6];

Condition2=Low>=Low[1] AND Low<=Low[2] AND Close>=Close[1] AND Close>=Open AND (Close-Open)<(High-Low) AND iVolume[1]>iVolume[2] AND iVolume[1]>iVolume[3] AND iVolume[1]>iVolume[4] AND iVolume[1]>iVolume[5] AND iVolume[1]>iVolume[6];



//HIGH VOLUME SPIKE SHORT SIGNAL

Condition3=High>=High[1] AND High>=High[2] AND Close<=Close[1] AND Close<=Open AND (Open-Close)<(High-Low) AND iVolume[1]>iVolume[2] AND iVolume[1]>iVolume[3] AND iVolume[1]>iVolume[4] AND iVolume[1]>iVolume[5] AND iVolume[1]>iVolume[6];

Condition4=High<=High[1] AND High>=High[2] AND Close<=Close[1] AND Close<=Open AND (Open-Close)<(High-Low) AND iVolume[1]>iVolume[2] AND iVolume[1]>iVolume[3] AND iVolume[1]>iVolume[4] AND iVolume[1]>iVolume[5] AND iVolume[1]>iVolume[6];




IF Condition1 OR Condition2 then
Plot1(1,"Spike") else
If Condition3 or Condition4 then
Plot1(-1,"Spike")
else
Plot1(0,"Spike");

Date Time Of Last Edit: 2013-06-30 21:16:39
imagevolume spike.JPG / V - Attached On 2013-06-30 21:16:36 UTC - Size: 56.88 KB - 802 views
[2013-06-30 23:35:04]
M5amhan - Posts: 468
=OR(AND(L<=L[-1],L<=L[-2],C>=C[-1],C>=C[-1],C>=O,(C-O)<(H-L),V[-1]>V[-2],V[-1]>V[-3],V[-1]>V[-4],V[-1]>V[-5],V[-1]>V[-6]),AND(L>=L[-1],L<=L[-2],C>=C[-1],C>=O,(C-O)<(H-L),V[-1]>V[-2],V[-1]>V[-3],V[-1]>V[-4],V[-1]>V[-5],V[-1]>V[-6]))

this is your "high volume spike long signal" condition 1 & 2. i dont know what "If bartype < 2 then iVolume = Ticks else IVolume = volume;" is supposed to mean. follow that frame work for your short signals code and use 2 "color background based on alert condition" studies and put long signal formula in one and short signal formula in another
[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 - 763 views
[2013-07-01 19:16:30]
vegasfoster - Posts: 444
I can do it if you do the legwork, take the nt code and put sc. in front of all the high, low, close, and volume, and put sc.Index- before each index reference, for example change High[1] to sc.High[sc.Index-1], then repost the code. Unless someone less lazy than me wants to do it. :)
Date Time Of Last Edit: 2013-07-01 19:17:05
[2013-07-02 05:12:27]
user85017 - Posts: 37
it's ok now thanks anyway

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account