GreatPig
Pigs In Space
- Joined
- 9 July 2004
- Posts
- 2,368
- Reactions
- 14
I've now uploaded a new version of this document to the AmiBroker Yahoo forum files section, to correct a couple of minor errors. Specifically, a couple of the DO loop examples were missing semicolons after the while condition.
I won't put the new version here as well, as I think one public copy is enough and I have the ability there to delete old versions myself when updating the file.
Cheers,
GP
Why do people almost always post ".... it doesn't work...." but don't exactly mention WHAT it is that is not working. Frustrating.
I don't think you are calling the custom function?
function Cbl(bars) {
}
cblArr = Null; if (bars > 0)
{
for (i = 1; i < BarCount; i++) {
steps = bars - 1;
mostLow = Low[i];
for (j = i-1; j >= 0 && steps > 0; j--) // Loop backwards over all ...
{
if (Low[j] < mostLow) {
mostLow = Low[j];
steps--; }
}
cblArr[i] = mostLow; }
}
return cblArr;
Hi Trash,
I'll elaborate....
I am using the following code:
SetOption ("Maxopenpositions", 5);
SetPositionsize (20, spsPercentofEquity);
Moving1 = MA (C,20);
Moving2 = MA (C, 50);
Buy = Cross (Moving1, Moving2);
Sell = Cross (Moving2, Moving1);
I then add on the Guppy code from page 20.
Issue 1:
The results are identical whether or not I use the Guppy code or not. So it appears the Guppy CBL stop loss is not being activated. This is confirmed by looking at a chart.
Issue 2:
In addition to the code on page 20 I add on the Guppy CBL trailing stop loss code on page 21. Again the results are identical.So it appears the Guppy Initial CBL and the trail CBL are not being activated.
I noticed that there could be an amendment to the code updated on the Yahoo Groups Forum. Having trouble finding it there. In any case is appears to be for Do Loop examples.
I have faith the code works. It's my lack of looping skills letting me down.
I hope this explains why I am asking the 2 questions in the previous post.
Assistance appreciated.
With thanks,
Tradezy
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?