#twitter-follow { border: 0;position: fixed; top: 240px; left:0;} #live-support { border: 0;position: fixed; top: 370px; left:0;} #knowledge-base { border: 0;position: fixed; top: 170px; left:0;}

## Swing Point Function (SP)

by SystemTra.de, 1767 days ago

If - while swing-trading - you want to buy e.g. when a higher swing high occurs after a higher swing low then you could set up your trading system as follows:
buy = sp(10, -1) > 0 && sp(10, 0) > sp(10, 2) && sp(10,1) > sp(10,3);

What does it mean?

The SP function returns the price level of any swingpoint occurred on or before the current bar.
There are two parameters to this function.
1. "bars" is the number of bars required to identify swing highs and lows.
2. "point" indicates the sequence number of a swingpoint. 0 is the most recent swingpoint. 1 is the preceeding one and so on. Note that you can set this parameter to -1. The function then will return the price level of the most recent swingpoint 0 with a positive sign if swingpoint 0 was a local high and it will return the level of swingpoint 0 with a negative sign if it was a local low. So you are able to define with only one function at every bar whether the last swingpoint was a high or a low and what the level of any preceeding swingpoint was.

Coming back to the example ...

sp(10, -1) > 0 checks if the most recent swingpoint (defined over 10 periods) was a high swing. sp(10, -1) < 0 would check on a low swing

sp(10, 0) > sp(10, 2) checks if the last high swing (swingpoint 0 as checked with the previous statement was higher than the high swing before (number 2, because there was a swing low number 1 in between). If you would have had sp(10, -1) < 0 in the previous statement to check on a low swing, then sp(10, 0) > sp(10, 2) here would mean a check if the last low swing was higher than the low swing before.

sp(10,1)) > sp(10, 3) checks if the last low swing (number 1) was higher than the low swing before (number 3).

This function is an enhancement to the Swing Trading Indicator (STI) recently shared. You do not need to download that one in addition, but if you are interested in more details, refer to Swing Trading Indicator (STI)

What is this?

 Type: Trading Indicator Object ID: 1121 Country: All Market: All Style: Technical Analysis

Related objects
Show All
Fibonacci Function (by SystemTra.de, uploaded several months ago)
No notes
 68
Optimizable Fibonacci Long and Short Trading System (by SystemTra.de, uploaded several months ago)
No notes
 84
No notes
 235
Price Channel Position (by swalk10, uploaded several months ago)
No notes
 62
No notes
 120
Ascending, Descending and Symmetrical Triangle Chart Patterns (by QuantShare, uploaded several months ago)
No notes
 87
Support and resistance lines based on N-Minutes high/low of a trading session (by Caleb, uploaded several months ago)
No notes
 28
Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

 Random Blog Posts Download quotes, news, sentiment, fundamental... data using QuantShare How to create the advance/decline market breadth indicator Display several stock market charts with one click Fundamental Screen based on Stock price, ROI and Market capitalization 6 techniques to improve the performance of your stock trading strategy Trading System: Buy stocks with the highest Sharpe ratio Create indicators, composites and trading systems using QL and CSharp Custom Indicator: Accumulation Distribution Line Show All

Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object