Log in to see Cloud of Tags

Wealth-Lab Wiki

Arms Index (TRIN)

RSS

Arms Index (TRIN Index): Indicator Documentation

Note! Actually, Arms Index isn't a part of the Community Indicators library. See code example below on how to calculate and plot the indicator.

Note! With MS123 IndexDefinitions library, constructing and plotting the Arms index (TRIN) for a DataSet has never been easier: no need to program, after installing the extension, just create it once using the Index Manager and then keep up to date.

Description

The Arms Index, also known as TRIN, was developed by Richard Arms and is an indicator which determines market strength and breadth by analyzing the relationship between advancing and declining issues and their respective volume.

References:


Example

This example illustrates how to construct and plot Arms Index using Market Sentiment provider's symbology. Switch the parameter slider to build Arms index based on NASDAQ, NYSE or AMEX stocks.


using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using Community.Indicators;

namespace WealthLab.Strategies { public class ArmsIndex : WealthScript { private StrategyParameter period; private StrategyParameter mkt; public ArmsIndex() { period = CreateParameter("Smoothing Period",21,2,300,1); mkt = CreateParameter("NASDAQ/NYSE/AMEX",0,0,2,1); } protected override void Execute() { string Market = string.Empty; Dictionary<int,string> symList = new Dictionary<int,string>(); symList.Add( 0,"NASDAQ" ); symList.Add( 1,"NYSE" ); symList.Add( 2,"AMEX" ); switch (mkt.ValueInt) { case 0: Market = symList[0]; break; case 1: Market = symList[1]; break; case 2: Market = symList[2]; break; }

// Get NASDAQ Advancing and Declining Issues and Volume "Market Sentiment" provider DataSeries AI = GetExternalSymbol( Market + "_advn", true ).Close; DataSeries DI = GetExternalSymbol( Market + "_decln", true ).Close; DataSeries AV = GetExternalSymbol( Market + "_advn", true ).Volume; DataSeries DV = GetExternalSymbol( Market + "_decln", true ).Volume;

// Calculate Arms Index DataSeries ADI = AI / DI; DataSeries ADV = AV / DV; DataSeries ArmsIndex = ADI / ADV; // Plot Arms Index ChartPane ArmsPane = CreatePane(30,true,true); PlotSeries( ArmsPane, ArmsIndex, Color.Brown, LineStyle.Solid, 1, "Arms Index for " + Market + " Stocks" );

// Smooth it DataSeries Smoothed = SMA.Series( ArmsIndex, period.ValueInt ); PlotSeries( ArmsPane, Smoothed, Color.Navy, LineStyle.Solid, 2 ); } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.