SwingConfidence Score

finallynitin アップデート済   
SwingConfidence is a scoring system that helps us quantitatively manage risk & position size in swing trading.

SwingConfidence uses T3 moving average to determine the swing state in which the instrument is in. So, this is supposed to be used with my previously posted Simple Swing with T3MA indicator. The T3MA ribbon consists of a fast and a slow moving average (MA). The ribbon is green when the fast MA is above the slow MA. This green ribbon represents the upswing. Similarly, the red ribbon represents the downswing.

The score takes into account the swing state of 2 chosen benchmark indices (by default, these are NIFTY & CNXSMALLCAP). It has 2 components:
- Weekly Swing
- Daily Swing

Weekly Swing
The script uses the Simple Swing indicator on weekly charts of of 2 benchmark indices to determine whether the index is in a weekly upswing or downswing.

- If the color of the weekly ribbon is green, we are in a weekly Upswing.
- If the color of the weekly ribbon is red, we are in a weekly Downswing.

Daily Swing
The script uses the Simple Swing indicator on daily charts of 2 benchmark indices to determine the daily swing state. There can be any one of total 6 swing states on a daily chart:

- Early Upswing (close above red ribbon)
- Confirmed upswing (green ribbon)
- Upswing under strain (close inside green ribbon)
- Early Downswing (close below green ribbon)
- Confirmed downswing (red ribbon)
- Downswing under strain (close inside red ribbon)

SwingConfidence Scoring
The script prints the Weekly & Daily Swing states, & assigns a score to each index from 0 to 50, where 0 is the most bearish score, & 50 is the most bullish score. The sum of the scores is the final SwingConfidence score. e.g. If both indices are in a confirmed upswing, then the score reads 50 + 50 = 100.

How to use the SwingConfidence score?

There are multiple ways by which we can use the SwingConfidence score:

- If the SwingConfidence value is 100%, then we can go in with the maximum open risk our strategy allows. As the score starts decreasing, we keep on closing/modifying our positions, so as to keep the open risk proportionately down. Once the score reaches to zero, we must not be having any open risk. We can achieve this by either going in all-cash, or bringing the stop losses to breakeven.

- Another way is to use this is via a progressive exposure method. If the SwingConfidence value is 100%, then we go with full position size (e.g. 1% capital-at-risk). If the value is 0%, we sit out in cash. Between these 2 extremes, we reduce/increase our position size accordingly.

Please note that this script will display only on the daily timeframe.
⦿ Mini-mode shows just the score, without the computation table
⦿ Dark mode with one-click
⦿ The position & the size of the table can now be changed
⦿ Now the user can change the index (or instrument) to the ones of his choice via the settings