PriceLevels Collection
<< Click to Display Table of Contents >> PriceLevels Collection |
A collection of PriceLevel objects defining lines for multi-price-level Drawing Tools (Fibonacci tools, etc.). Each PriceLevel within the collection can be configured programmatically or analyzed to obtain the parameters of user-drawn objects.
Note: PriceLevels is only used with the following pre-built Drawing Tools, but it can be used with custom Drawing Tools, as well:
|
PriceLevels[int idx]
PriceLevels[int idx].GetPrice(double startPrice, double totalPriceRange, bool isInverted)
PriceLevels[int idx].GetY(ChartScale chartScale, double startPrice, double totalPriceRange, bool isInverted)
GetPrice() |
Returns a double which repents the price value at the specified price level |
GetY() |
Returns a float representing the y-pixel coordinate at the specified price level |
Name |
The Name property of the specified PriceLevel. Set to a formatted version of Value by default. |
Stroke |
The Stroke used to draw the line associated with the specified PriceLevel |
Tag |
A tag used to identify the specified PriceLevel. Null by default. |
Value |
The value of the PriceLevel in percentage terms |
// Define a FibonacciRetracements object outside of OnBarUpdate(), so the same object can be re-used // setting isInverted correctly is important for the Fibonacci Retracements since it will define which starting point is used, as it changes based // on the anchors, i.e. if the Fibonacci is drawn from 100% to 0% (default) or the other inverted way (0% to 100%). |
// Define a TrendChannel object outside of OnBarUpdate(), so the same object can be re-used // For the TrendChannel the 0% is the Trend anchor, the 100% the Parallel anchor |