Profile Picture

IndicatorMath in RE2008 Ed1

Posted By DoQ 9 Years Ago
Message
DoQ
Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)
Posted Wednesday May 14 2008
What happened to IndicatorMath.WildersSmoothingValue??


DoQ_Indicators
"better is the enemy of good enough"
Posted Wednesday May 14 2008
It was moved to WildersSmoothingQueue.  Since the computation is potentially expensive, we put it in a queue that could be reused much like StdDevQueue or RSIQueue.

DoQ (5/14/2008)
What happened to IndicatorMath.WildersSmoothingValue??
DoQ
Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)
Posted Wednesday May 14 2008
Ok, so how would I get the equivalent of:

double x = IndicatorMath.WildersSmoothingValue(aList, aList.Count - 1, Period);

 

thx in advance




DoQ_Indicators
"better is the enemy of good enough"
Posted Wednesday May 14 2008
You would create an instance of WildersSmoothingQueue which takes a period parameter.

For each value, you would call AddValue() with your current price.  It will perform the calculation and you can get the current value by using the Value property.

The difference here is that you're going to be adding a value at a time to the queue instead of passing in the whole list and referencing by index.

WildersSmoothingQueue queue = new WildersSmoothingQueue(14);

// ...

public void NewBar()
{
   queue.AddValue(newPrice);
   // Get latest calculation
   double x = queue.Value;
}

With the old way, we'd have to perform a full recalculation each time you called WildersSmoothingValue();

DoQ (5/14/2008)
Ok, so how would I get the equivalent of:

double x = IndicatorMath.WildersSmoothingValue(aList, aList.Count - 1, Period);

 

thx in advance

Posted Wednesday May 14 2008
off the top of my head (may require tweaking):

WilderSmoothingQueue wilders = new WilderSmoothingQueue(periods)

foreach(double d in alist) { wilders.AddValue(d); }

double finalValue = wilders.Value;

DoQ
Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)
Posted Wednesday May 14 2008
Ok, thanks much appreciated. Got it to work. I was calling this within an indicator, works great just as well.


DoQ_Indicators
"better is the enemy of good enough"


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems