RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        


««12

Many more indicators Expand / Collapse
Message
Posted 9/16/2009 07:40:37 Post #9454
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
Actually, I just double checked the spreadsheet and it does not contain calcs for Zig Zag, but the book does. Let me know if you're having problems with the formula on Zig Zag and I'll be happy to help.

vitor dantas (9/15/2009)
Thank´s a lot !!
Posted 9/16/2009 15:19:33 Post #9466
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Bilb, thanx alot your help !!! i have this book and saw the description on page 372 but it doesn´t show the formula. What i´m trying to change is veru simple, instead of marking the close price, use  - if relative high  - use the High value and if relative low use the low value. I believe that with the code it´s a piece of cake to change that, if you could help me i would be very very gratefull !!

                            Thanx Vitor

Posted 9/17/2009 08:20:40 Post #9473
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
I cleared it with the boss to give you this snippet. Our ZigZag calculation.

public override void AppendBar(BarData bar)
{
pBars.Add(bar);
int pBarIndex = pBars.Count - 1;

if (pBarIndex == 0)
{
startPrice = BarUtils.GetValueForBarElement(bar, barElement);
startIndex = pBarIndex;
_values.Add(startPrice);
}
else
{
double priceChange = percent / 100.0;
double todaysPrice = BarUtils.GetValueForBarElement(bar, barElement);

if (todaysPrice > (startPrice + (startPrice * priceChange)) || todaysPrice < (startPrice - (startPrice * priceChange)))
{
double endPrice = todaysPrice;
int endIndex = pBarIndex;
double slope = (endPrice - startPrice) / (double)(endIndex - startIndex);

double currentPrice = startPrice;
for (int i = startIndex + 1; i < endIndex; i++)
{
currentPrice += slope;
_values.SetValue(_values.Count - i - 1, currentPrice);
}

_values.Add(endPrice);
startPrice = endPrice;
startIndex = endIndex;
}
else
{
_values.Add(double.NaN);
}
}
}
Posted 9/17/2009 10:58:44 Post #9481
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Thank´s a lot Billb !!!!  Very gratefull  !!!! Really you are the best in market , thank´s again !!!
« Prev Topic | Next Topic »

««12

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb, young, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 6:09am

2005-2007 © RightEdge Systems