Description
The zigzag is an Indicator that is usually used as a filter of small price momements.
u
KK
kkostaki
Joined on 24.08.2012
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: ZigZag.algo
- Rating: 5
- Installs: 26840
- Modified: 13/10/2021 09:54
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
EL
Sorry, AUDUSD not EURUSD.
EL
- A bit late, but yeah there is a bug with it.
2010/10/30 12:15 UTC M15 EURUSD
Made a lower low, it should not have since it was in the catchment for the low, but at the same time made a new high also, (but obviously later moved with higher being made).
KK
You need to remove Source from the initialization:
_zigZag = Indicators.GetIndicator(ZzDepth, ZzDeviation, ZzBackStep);
BF
There is a bug in this indi. I don't know if anyone has noticed but sometimes there will be a bar that has made a lower low on the bottom or a higher high on the top within a few bars and the zigzag will not establish itself for that new higher high or lower low.
PH
Hi kkostaki,
I am trying to use zigzag as trend like others but I do not know why it is not working right. Could you please help me? below is my code
protected override void OnStart()
{
// _matype = MovingAverageType.Simple;
_zigZag = Indicators.GetIndicator(Source, ZzDepth , ZzDeviation, ZzBackStep);
}
protected override void OnBar()
{
if (Trade.IsExecuting) return;
int lastindex = _zigZag.Result.Count - 2;
int previndex = _zigZag.Result.Count - 3;
lastValue = _zigZag.Result[lastindex];
prevValue = _zigZag.Result[previndex];
bool isLongPositionOpen = position != null && position.TradeType == TradeType.Buy;
bool isShortPositionOpen = position != null && position.TradeType == TradeType.Sell;
if (lastValue > prevValue && !isLongPositionOpen)
{
ClosePosition();
Buy();
}
if (lastValue < prevValue && !isShortPositionOpen)
{
ClosePosition();
Sell();
}
}
thanks in advance
Hi,
could you please give us the indicator without bugs to download ?
Thanks for your support !