File Name: SVEHLZZPercent.efs
Description:
Riding The Zigzags by Sylvain Vervoort
Formula Parameters:
SVEHLZZPercent.efs
ZigZag percent: 5
ATR Look back Period: 5
ZigZag ATR factor: 1.5
Color of ZigZag lines: blue
Lines Width: 1
Notes:
The related article is copyrighted material. If you are not a subscriber
of Stocks & Commodities, please visit www.traders.com.
Download File:
SVEHLZZPercent.efs
SVEHLZZPercent.efs
EFS Code:
Description:
Riding The Zigzags by Sylvain Vervoort
Formula Parameters:
SVEHLZZPercent.efs
ZigZag percent: 5
ATR Look back Period: 5
ZigZag ATR factor: 1.5
Color of ZigZag lines: blue
Lines Width: 1
Notes:
The related article is copyrighted material. If you are not a subscriber
of Stocks & Commodities, please visit www.traders.com.
Download File:
SVEHLZZPercent.efs
SVEHLZZPercent.efs
EFS Code:
PHP Code:
/*********************************
Provided By:
Interactive Data Corporation (Copyright © 2013)
All rights reserved. This sample eSignal Formula Script (EFS)
is for educational purposes only. Interactive Data Corporation
reserves the right to modify and overwrite this EFS file with
each new release.
Description:
High-Low ZigZag indicator
Version: 1.00 10/04/2013
Formula Parameters: Default:
ZigZag percent 5
ATR Look back Period 5
ZigZag ATR factor 1.5
Color of ZigZag lines blue
Lines Width 1
Notes:
The related article is copyrighted material. If you are not a subscriber
of Stocks & Commodities, please visit www.traders.com.
**********************************/
var pArray = new Array();
function preMain()
{
setStudyTitle("High-Low ZigZag indicator");
setComputeOnClose();
setPriceStudy(true);
var x = 0;
pArray[x] = new FunctionParameter("fpZigZagPercentage", FunctionParameter.NUMBER);
with(pArray[x++])
{
setName("ZigZag percent");
setLowerLimit(0);
setDefault(5);
}
pArray[x] = new FunctionParameter("fpATRPeriod", FunctionParameter.NUMBER);
with(pArray[x++])
{
setName("ATR Look back Period");
setLowerLimit(1);
setDefault(5);
}
pArray[x] = new FunctionParameter("fpATRFactor", FunctionParameter.NUMBER);
with(pArray[x++])
{
setName("ZigZag ATR factor");
setLowerLimit(0);
setDefault(1.5);
}
pArray[x] = new FunctionParameter("fpZigZagColor", FunctionParameter.COLOR);
with(pArray[x++])
{
setName("Color of ZigZag lines");
setDefault(Color.blue);
}
pArray[x] = new FunctionParameter("fpLineWidth", FunctionParameter.NUMBER);
with(pArray[x++])
{
setName("Lines Width");
setLowerLimit(1);
setDefault(1);
}
}
var nTrend = 0;
var nLHb = 0;
var nLLb = 0;
var nHH = 0;
var bLL = 0;
var nDownlineID = 0;
var nUplineID = 0;
var nHLPivot = 0;
var xATR = null;
var bInit = false;
var bVersion = null;
function main(fpZigZagPercentage, fpATRPeriod, fpATRFactor, fpZigZagColor, fpLineWidth)
{
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;
if(!bInit)
{
xATR = atr(fpATRPeriod);
bInit = true;
}
var nBarNumber = getCurrentBarCount();
if(nBarNumber < 2)
{
bLL = low(0);
nHH = high(0);
nLLb = nLHb = 1;
nUplineID = nDownlineID = nBarNumber;
nTrend = 1;
return;
}
var nATR = xATR.getValue(0);
if (nATR == null)
return;
if(fpATRFactor == 0)
{
nHLPivot = fpZigZagPercentage * 0.01;
}
else
{
if (fpZigZagPercentage == 0)
{
nHLPivot = nATR / close(0) * fpATRFactor;
}
else
{
nHLPivot = fpZigZagPercentage * 0.01 + nATR / close(0) * fpATRFactor;
}
}
if (nTrend > 0)
{
if (high(0) >= nHH)
{
nHH = high(0);
nLHb = nBarNumber;
drawLineRelative(-(nBarNumber - nLLb), bLL, 0, nHH, PS_SOLID, fpLineWidth, fpZigZagColor, nUplineID);
}
else if (low(0) < nHH - nHH * nHLPivot)
{
bLL = low(0);
nLLb = nBarNumber;
nDownlineID = nBarNumber;
nTrend = -1;
drawLineRelative(-(nBarNumber - nLHb), nHH, 0, bLL, PS_SOLID, fpLineWidth, fpZigZagColor, nDownlineID);
}
}
else
{
if (low(0) <= bLL)
{
bLL = low(0);
nLLb = nBarNumber;
drawLineRelative(-(nBarNumber - nLHb), nHH, 0, bLL, PS_SOLID, fpLineWidth, fpZigZagColor, nDownlineID);
}
else if (high(0) > bLL + bLL * nHLPivot)
{
nHH = high(0);
nLHb = nBarNumber;
nUplineID = nBarNumber;
nTrend = 1;
drawLineRelative(-(nBarNumber - nLLb), bLL, 0, nHH, PS_SOLID, fpLineWidth, fpZigZagColor, nUplineID);
}
}
}
function verify()
{
var b = false;
if (getBuildNumber() < 779)
{
drawTextAbsolute(5, 35, "This study requires version 8.0 or later.",
Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
null, 13, "error");
drawTextAbsolute(5, 20, "Click HERE to upgrade.@URL=http://www.esignal.com/download/default.asp",
Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
null, 13, "upgrade");
return b;
}
else
{
b = true;
}
return b;
}