ScrewTurn

Active Trader Strategies API Community ChartStyles Community Commissions Community Components Community Indicators Community Providers Community Visualizers Knowledge Base Misc Optimizers PosSizers Standard Indicators TASC Traders Tips TASCIndicators Tutorial Videos
RSS

Navigation







Quick Search
»
Advanced Search »

PoweredBy

Description

VKW Bands is a variation of VK Bands that uses a weighted moving average calculation.

Rules: Enter long on the next open when the market closes below the lower band.
Exit on the next open when the market closes above the upper band.

Code


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 VKWBandsSystem : WealthScript { protected override void Execute() { VK_WH_Band VK_WH1 = VK_WH_Band.Series( High,10,10 ); PlotSeries( PricePane, VK_WH1, Color.DarkBlue, LineStyle.Solid, 2 ); VK_WL_Band VK_WL1 = VK_WL_Band.Series( Low,10,10 ); PlotSeries( PricePane, VK_WL1, Color.DarkBlue, LineStyle.Solid, 2 ); VK_SH_Band VK_SH1 = VK_SH_Band.Series( High,10,10 ); PlotSeries( PricePane, VK_SH1, Color.LightBlue, LineStyle.Solid, 2 );

for(int bar = 20; bar < Bars.Count; bar++) { if (!IsLastPositionActive) { if( Close[bar] < VK_WL1[bar] ) BuyAtMarket( bar + 1 ); } else { if( Close[bar] > VK_WH1[bar] ) SellAtMarket( bar + 1, LastPosition ); } } } } }

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.

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


ScrewTurn Wiki version 3.0.2.509. Some of the icons created by FamFamFam.