Swing
Description
Based on the strength of the swing highs or the swing lows, the swing indicator draws a line at these points. The number of bars to the left and right of the extreme point is the determining factor for the strength. Methods for these indicators can also be implemented for other scripts.
Interpretation
The methods for these indicators can be used in scripts to determine the last extreme point and its corresponding price value. The highs and lows of these points may then be used as entry, stop or target markers.
Usage
Return value
double
When using this method with an index (e.g. Swing(5)[int barsAgo] ), the value of the indicator will be issued for the referenced bar.
When the current bar is smaller than the parameter strength, or if no swing high/low has been found, the return value is -1.
Parameters
barsAgo | Starting point for the search |
InSeries | Input data series for the indicator |
instance | The number of occurrences of extreme points (1 is the last occurrence, 2 is the second last occurrence etc.) |
length | Number of bars included in the calculation |
lookBackPeriod | Number of bars in the past in which swing points will be searched for (search area) |
strength | Number of bars to the left and right of the extreme points |
Visualization
Example
Last updated