Wealth-Lab Wiki

API ChartStyles Community Components Community Indicators IndexDefinitions Knowledge Base Misc Optimizers Pending Deletion PosSizers Providers Standard Indicators TASC Traders Tips TASCIndicators Tutorial Videos Visualizers
RSS

Navigation


Quick Search
»
Advanced Search »


TASC 2008-09 | The Midas Touch (Cole)

RSS

Traders' Tip text

We’ve added Midas to our collection of drag-and-drop indicators from TASC magazine (Fig. 1, inset). By including the starting bar number as a parameter, the indicator is fully programmable, and, our script demonstrates how a number of Midas curves can be effortlessly added to a chart for quick viewing. The script plots five Midas indicators for the most-recent 7% peaks and troughs.

Image

Figure 1. The indicators were plotted automatically by programming a simple peak/trough search and using the bar number results to obtain a new Midas indicator.

Strategy Code

Note! Requires TASCIndicators 1.0.2 or greater.

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

namespace WealthLab.Strategies { public class MidasTouch : WealthScript { protected override void Execute() { const int c = 6; const double pct = 7d; Color[] color = new Color[c]; color[0] = Color.Blue; color[1] = Color.Red; color[2] = Color.BlueViolet; color[3] = Color.Fuchsia; color[4] = Color.Green; DataSeries ap = AveragePrice.Series(Bars); DataSeries pbSer = PeakBar.Series(ap, pct, PeakTroughMode.Percent); DataSeries tbSer = TroughBar.Series(ap, pct, PeakTroughMode.Percent); int bar = Bars.Count - 1; int n = 0; while (bar > 1 && n < c) { int pb = (int)pbSer[bar]; int tb = (int)tbSer[bar]; bar = Math.Max( pb, tb ); DataSeries midas = Midas.Series(Bars, bar); PlotSeries(PricePane, midas, color[n], LineStyle.Solid, 2); n += 1; bar -= 1; } } } }

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.

Used under license from FMR Corp. Copyright 2008 FMR Corp. All rights reserved.


ScrewTurn Wiki. Some of the icons created by FamFamFam.