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

Created by Volker Knapp

"The idea behind this system is to find opportune points at which to catch an intraday trend. It measures the change between five-minute bars to determine when a sharp, short-term move against the prevailing trend has occurred that is likely to be reversed. The goal is to enter when the market is actually in the process of making the pullback, rather than waiting for the pullback to complete and price to move beyond the most recent high (as do most breakout systems").

Code


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

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Dip size % double Dip = 0.5; // Stop Loss % double StopLoss = 3.2; int firstBar = 0; double prevClose = 0;

// Check for intraday data if ( Bars.IsIntraday ) { // Get daily bars SetScaleDaily(); Bars daily = Bars; RestoreScale(); daily = Synchronize( daily ); PlotSeries( PricePane, daily.Close, Color.Black, WealthLab.LineStyle.Solid, 1 );

for(int bar = 20; bar < Bars.Count; bar++) { if( daily.IntradayBarNumber(bar) == 0 ) { if( daily.Date[bar] > daily.Date[bar-1] ) { firstBar = bar; prevClose = daily.Close[bar-1]; } if( bar == firstBar ) SetBarColor( bar, Color.Yellow ); } if( IsLastPositionActive ) { if ( Bars.IsLastBarOfDay( bar ) ) SellAtClose( bar, LastPosition, "At Close" );

SellAtStop( bar+1, LastPosition, LastPosition.EntryPrice * ( 1 - StopLoss/100 ), "Stop" ); } else { if( bar >= firstBar ) if( Bars.Close[bar] < ( Bars.Low[bar-1] * ( 1 - Dip/100 ) ) ) if( Bars.Close[bar] > prevClose ) BuyAtMarket( bar+1, "Buy" ); } } } else DrawLabel( PricePane, "For use on intraday data", Color.Red ); } } }

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.