- Joined
- 14 April 2007
- Posts
- 317
- Reactions
- 0
This is another logical issue, not a problem with the Zig Zag indicator. You can't identify any point as a peak or trough until you've had some degree of retracement after it. At that point you can go back and identify the peak or trough, but of course it's too late to buy or sell at that turning point (naturally performance will be good if you do use the peak and trough bars as signals).
For example, if you say a turning point is defined by a 10% retracement, then you can only generate a buy or sell 10% above a trough or below a peak. As long as you only use the bar where the peak or trough is determined, and not the peak or trough bar itself, then you can safely backtest it (mind you, that's not all that easy).
So you can write alternatives to the Zig Zag indicator to do the same thing, but you can't get around the logical issue that a peak or trough can only be known in hindsight after some amount of retracement.
GP
This is not so easy in AFL (and 10-20 steps is a very wide stop). I'm not sure which code of mine you are referring to, as I only remember mentioning countback line code in a plugin (plus the AFL to reference it). If you're perhaps trying to use the AFL without having the plugin, then you will have a problem. The version of AB shouldn't matter.
Which code of mine are you referring to, and what exactly are the syntax errors you are getting?
GP
I wasn't referring to the Zig Zag indicator, which I've never used and don't know how it works. What I really meant is that doing your own code to determine where the peaks and toughs are based on a certain amount of retracement and then using that information as part of a backtest may not be that easy (depending on exactly what you try to do with the information).Can I ask why you commented that it isn't easy to backtest the Zig Zag indicator?
If you have the code in the order you quoted then you shouldn't get that error, as Stop is initialised by the call to the plugin. However, if you don't have the plugin, then I would expect some error relating to that, but it may also give the error you indicate since the Stop array would then not be initialised by the call to the plugin (since the plugin would not be there)."Variable 'stop' used without being initialized".
I wasn't referring to the Zig Zag indicator, which I've never used and don't know how it works. What I really meant is that doing your own code to determine where the peaks and toughs are based on a certain amount of retracement and then using that information as part of a backtest may not be that easy (depending on exactly what you try to do with the information).
Cheers,
GP
If you have the code in the order you quoted then you shouldn't get that error, as Stop is initialised by the call to the plugin. However, if you don't have the plugin, then I would expect some error relating to that, but it may also give the error you indicate since the Stop array would then not be initialised by the call to the plugin (since the plugin would not be there).
Cheers,
GP
3. Only planning to use EOD data.
If you have the IB plugin where you can run the live data from IB through Amibroker do you need professional to run this intraday data or will the standard version still suffice?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?