0% found this document useful (0 votes)
473 views2 pages

Weis Wave

The document contains code for a WeisWave indicator that analyzes price movement trends and volume to identify bullish and bearish swings. It calculates trend, wave, volume, and up/down variables over bars of data. If the close changes more than a reversal parameter, the trend is set accordingly. The wave follows the trend unless the price change is large enough. Volume accumulates within a wave but resets between waves. Up volume tracks bullish waves and down volume tracks bearish waves. Charts are plotted to visualize the swings.

Uploaded by

bharatbaba363
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
473 views2 pages

Weis Wave

The document contains code for a WeisWave indicator that analyzes price movement trends and volume to identify bullish and bearish swings. It calculates trend, wave, volume, and up/down variables over bars of data. If the close changes more than a reversal parameter, the trend is set accordingly. The wave follows the trend unless the price change is large enough. Volume accumulates within a wave but resets between waves. Up volume tracks bullish waves and down volume tracks bearish waves. Charts are plotted to visualize the swings.

Uploaded by

bharatbaba363
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

_SECTION_BEGIN("WeisWave");

//up[0] = V[0];
//dn[0] = V[0];
//vol[0] = V[0];
trend[0] = 0;
wave[0] = 0;
vol[0] = 0;
mov[0] = 0;
dif=1;
rp = Param("Reversal Bars", 0.03,0.1,5,0.1);
for( i=1; i<BarCount; i++) {

if (Close[i]-Close[i-1]>rp) mov[i]=1;
if (Close[i]-Close[i-1]==rp) mov[i]=0;
if (Close[i]-Close[i-1]<-rp) mov[i]=-1;

if ((mov[i]!=0) && (mov[i]!=mov[i-1]))


{
trend[i]=mov[i];
}
else {trend[i]=trend[i-1];}
if ((trend[i]!=wave[i-1]) && (abs(Close[i]-Close[i-1])*10000>=dif))
{
wave[i]=trend[i];
}
else
{
wave[i]=wave[i-1];
}
if (wave[i]==wave[i-1])
{
vol[i]=vol[i-1]+Volume[i];
}
else
{
vol[i]=Volume[i];
}

if (wave[i]==1)
{
up[i]=vol[i];
dn[i]=0;
}
if (wave[i]==-1)
{
dn[i]=vol[i];
up[i]=0;
}
if (wave[i]==0)
{
dn[i]=vol[i-1];
up[i]=vol[i-1];
}
}

PlotOHLC(0,up,0,up,"SwingWave",5 , 2|styleThick ) ;
PlotOHLC(0,dn,0,dn,"",4 , 2|styleThick ) ;
GfxSetOverlayMode(1);
GfxSetTextColor(10);
GfxSelectFont("MS Sans Serif", 6, 300, False, False, 0);
_SECTION_END();

You might also like