Wealth-Lab Wiki Page Editing

Modified on 2010/08/25 10:19 by Eugene — Categorized as: Misc


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

namespace WealthLab.Strategies { public class Squeeze : WealthScript { protected override void Execute() { DataSeries Squeeze = ( BBandUpper.Series( Close, 20, 2 ) - BBandLower.Series( Close, 20, 2 ) ) - ( KeltnerUpper.Series( Bars, 20, 20 ) - KeltnerLower.Series( Bars, 20, 20 ) ); Squeeze.Description = "Squeeze"; ChartPane SqueezePane = CreatePane( 30, true, true ); PlotSeries( SqueezePane, Squeeze, Color.Blue, WealthLab.LineStyle.Histogram, 3 ); for(int bar = Squeeze.FirstValidValue; bar < Bars.Count; bar++) { if (IsLastPositionActive) { if( CumDown.Series( Momentum.Series( Close, 14 ), 1 )[bar] >= 1 ) SellAtMarket( bar+1, LastPosition, "MomExit" ); } else { if( Squeeze[bar] < 0.00 ) BuyAtMarket( bar+1 ); } } } } }