Here you can search through the pages of this Namespace, their attachments and the files uploaded to the system.
Note: the results will only display the items you have permissions to read.
[...] already) the library from the www.wealth-lab.com site to its latest version 2013.04 or higher. Figure 1. A Wealth-Lab 6 chart pinpoints Engulfing, Downstep and Upstep patterns that occurred at reversal points on a chart of AAPL (Apple Inc).
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using WealthLab.Rules.Candlesticks;
using TASCIndicators; namespace WealthLab.Strategies
{
public class IRSTS_StepPattern : WealthScript
{
private StrategyParameter paramPercent;
private StrategyParameter [...]
[...] Indicators library which should be installed additionally from our website's Extensions section. Figure 1 illustrates trades taken by all the four trading systems at the same time on the Daily chart of USO (U.S. Oil Fund). 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 TASC201610Katsanos : WealthScript
{
private StrategyParameter paramStrategy2Run;
public TASC201610Katsanos()
{
paramStrategy2Run [...]
[...] first 100 bars, the initial trades can still be sensitive to the length of the seed data. Figure 1. The strategy presciently reversed near the top and held the Aussie short from July - Dec 2008. Download the attachment for the ASCII Data used for the article and the Strategy below. (Attachments are available only to registered Wealth-Lab Pro/Developer customers). If using your own data, be sure to make the secondary symbol changes in the code as required. Strategy Code
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using [...]
[...] from recent peaks or troughs. System rules Once a bullish divergence is detected, enter long next bar at open if MFO is below its centerline Exit long next bar at open when MFO crosses above the centerline Trades from the short side are deliberately not taken as their performance seems poor. Figure 1. Bullish divergence between the MFO and price formed in June 2015 triggered a long trade in KO (Coca Cola). After updating the TASCIndicators library to v2015.09 or later, the MoneyFlowOscillator indicator [...]
[...] the ADX is below its threshold for a trending market, the system would enter the trade. Figure 1. Bearish divergence between the SRSI and price which formed in January 2014 triggered a short trade in KO (Coca Cola). After updating the TASCIndicators library to v2015.06 or later, the SRSI indicator can be found under the TASC Magazine Indicators group. You can plot it on a chart or use it as an entry or exit condition in a Rule-based Strategy without having to program a line of code yourself.
using System;
using System.Collections.Generic;
using System.Text;
using [...]
[...] application to spot medium-term divergences on the chart if you run enclosed C# Strategy code. Figure 1 . A divegence in Procter & Gambler stock (PG) with three tops that formed in a year. C# Code
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using TASCIndicators; namespace WealthLab.Strategies
{
/*
Divergence: price sets a lowest low but the indicator fails to confirm the new low and turns up
*/
public class WDMACD_Divergence : WealthScript
{
private StrategyParameter [...]
[...] right will change between the six choices and make the chart update with backtested trades.
Figure 1. Sample entries on a Daily chart of QLD. Data provided by Yahoo! Finance. For example, Figure 1 illustrates a bearish and two bullish key reversal trades created on the next open following the pattern and exiting 3 days after. Through another parameter slider you can control exits after N bars in a trade. To avoid copy/paste, hitting Ctrl-O and choosing “Download…” in Wealth-Lab gets you the downloadable Strategy under the “Chart patterns” [...]
Bars, Loops, and Bar + 1
Original article by Robert Sucher in the legacy Knowledge Base here .
Wealth-Lab Developer has features such as order slippage and variable commissions to bring trading simulation as close to reality as possible. Likewise, your task as a trading system designer is to express your system in C# code that validly recreates security orders as they would have been and will be executed in real life. Bar Definition
A bar is any interval of time that has an [...]
[...] for easy reference in users' Strategies. Here's the complete list of Strategy rules: Enter long next bar at open if following conditions are met:
Stock price greater than $1 50-day simple moving average of volume is greater than 100,000 Yesterday’s close was less than the day before Yesterday’s close was less than its open Today’s open is greater than yesterday’s close Today’s close is greater than yesterday’s open Today’s open is less than yesterday’s open As of yesterday’s close, price had been closing lower for three days Sell short [...]
[...] choose any type of trade: inside S3/R3, outside S3/R3, and breakouts from S4/R4 levels. Figure 1. This 5-minute chart of QQQ illustrates the application of the multi-timeframe Camarilla Points breakout & reversion trading system. The two trades was caused by the market opening inside S3/R3 thresholds. The system's unabridged C# code for Wealth-Lab can be found below. On a closing note, motivated traders may also want to explore “Woodies Pivots” – whose difference from the rest of the breed (floor trader pivots, Camarilla points or Fibonacci pivots) is that they [...]
[...] to create a Pullback in an Uptrend entry. For instance, in an established uptrend, wait for a three bar pullback and
enter at stop $0.10 above prior bar high. However, the Rule Wizard doesn't seem to have "Buy at Stop" rule desired. Solution:
You can get pretty close by starting with these rules: BuyAtLimit (High)
- Moving Average is trending up (Moving Average group)
- Price decreases a consecutive number of bars (Price (or Volume) group) ..and add an exit (if you only want a screen, see Techniques > Creating a Screener in the WealthScript [...]
[...] WealthScript can be found in the TASC Traders’ Tips section at the Wealth-Lab.com Wiki site. Figure 1. The Trend Vigor’s ominous corona in June provided a good warning that MSFT’s March-April rally had lost its steam.
Strategy Code Revised: 20090611
Thanks to Wealth-Lab.com user "htg1", the calculation for the Trend variable used for "Trend Vigor" is now correct. Additionally, the starting loop variable was changed from 12 to 51, and DataSeries initializations have been simplified. // WAS:
double Trend = ds bar - ds cycPeriod ;
// [...]
[...] chnlLength;
public MyStrategy()
{
D1DXY = CreateParameter("DX LRSlope Period", 25, 10, 50, 1);
D2SNL = CreateParameter("Snl LRSlope Period", 12, 5, 25, 1);
LRSDXYSELL = CreateParameter("DX LRSlope", 0.3, 0.1, 0.8, 0.1);
LRSNLSELL = CreateParameter("Snl LRSlope", -0.8, -1.2, -0.5, 0.1 );
MASELL = CreateParameter("Soybean EMA Period", 15, 5, 25, 1);
MASNL = CreateParameter("Snl [...]
[...] setups aimed at identification of the start of a trending move and top/bottom-picking. ''Figure 1. Weekly chart of PFE (Pfizer) illustrating the application of the TAC-DMI approach.
WealthScript Code (C#)
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators; namespace WealthLab.Strategies
{
public class TAC_DMI_Strategy : WealthScript
{
#region Convergence functions
double Average(List lst)
{
double total = 0.0;
double average = 0.0;
int period = lst.Count;
if( [...]
[...] profit factor for the last 6 years of trading on the Dow 30 and Nasdaq 100 index components.
Figure 1. Representative trades from the sample Strategy. WealthScript Code (C#)
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators; namespace WealthLab.Strategies
{
public class EmpiricalModeDecomp : WealthScript
{
StrategyParameter _period;
StrategyParameter _delta;
StrategyParameter _fraction;
public EmpiricalModeDecomp()
{
_period = CreateParameter("Period", [...]
[...] above the 2nd one and the previous value was less than or equal to the target value at the previous bar. Motivated traders can compare approaches by commenting and uncommenting these lines:
if( CrossUnder( bar, tpEma, haEma ) )
//if( tpEma bar bar )
...
if( CrossOver( bar, tpEma, haEma ) )
//if( tpEma bar > haEma bar )
To run the sample Strategy in Wealth-Lab, you'll need the TASCIndicators [...]
[...] depending on the phase angle. We define an uptrend when the CorrelationAngleÆs state ôflatlinesö at 1 for 2 bars (or -1 for a downtrend). The logic is simple. An uptrend switches the system into trend following mode, with entries and exits made via channel breakout. If permitted, short trades are done in the same manner in a downtrend -- yet with a shorter lookback period for the channel. An absense of trend directs the system to take cyclic trades: buying small dips and selling at the high of the channel. Here are the rules: Buy at stop [...]
[...] HighlightPattern that you might find useful in other pattern-recognition scripts. As can be seen in Figure 1, the three-bar pattern occurs more frequently that you otherwise might expect in the CL, SI, and GC (shown) electronic sessions. Figure 1. The light gray and blue boxes highlight the short and long setups, respectively.
While testing the code, we noticed that short trade triggers (the last bar in the pattern) whose Close was below the Low of the previous bar [...]
[...] the average MTR by 3 standard deviations of MTR or greater. An entry is triggered when: Buy next bar at market if today's close price has declined. Short next bar at market if today's close price has increased. A position is exited with a simple trailing channel exit: Exit long when today's low price has broke below the 3-day lowest price. Cover short when today's high price has broke above the 3-day highest price. This system is merely a proof-of-concept. Among possible enhancements to this barebone system, the following can be [...]
[...] all it takes is to click the "Download" button in Wealth-Lab's "Open Strategy" dialog. Figure 1. A Wealth-Lab Developer 6.2 chart showing the Price Zone Oscillator strategy in action applied to a Daily chart of Walt Disney Co. ( DIS ). Although the new complementary oscillator implementation is pretty straightforward, the accompanying system rules have to function in different market regimes and cover such events as positive and negative price/oscillator divergences. The complexity of their implementation is hidden in an additional library, "Community Components" [...]
[...] configure its sensitivity by triggering a trading signal after one, two or three divergences on the same bar. Figure 1 illustrates the application of the system's rules on the Daily chart of QQQ. The lower pane shows the 5-, 8-, and 13-day linear regression slope of the recent close price.
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators; namespace WealthLab.Strategies
{
enum Side { Buy = 1, Sell = -1, [...]
[...] all it takes is to click the "Download" button in Wealth-Lab's "Open Strategy" dialog. Figure 1. A Wealth-Lab Developer 6.1 chart showing the Volume Zone Oscillator strategy in action applied to Natural Gas, continuous futures contract ( NG20_I0B , daily). Although the new oscillator implementation is pretty straightforward, the accompanying system rules have to function in different market regimes and cover such events as positive and negative price/oscillator divergences. The complexity of their implementation is hidden in additional [...]
[...] lower peak. (To save space, the rules are for short trades but reversing them is pretty easy.) Figure 1. Illustrating on a short trade in Sugar futures, the "Leader of the MACD" helps spot a complex bearish divergence. Strategy Code
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators; namespace WealthLab.Strategies
{
public class LeaderOfMACD : DataSeries
{
public LeaderOfMACD ( Bars bars ) : base(bars,"Leader of the MACD")
{
EMACalculation cm = EMACalculation.Modern;
EMA [...]
[...] time when selling pressure is greater than 0 Sell tomorrow at open if selling pressure = 0 Figure 1. Sample entries on a Daily chart of Halliburton. Data provided by Tiingo, source: IEX exchange. As seen on Figure 1, the trading system just marks the entries. You can make it more reactive by relaxing the exit condition - for example, require a greater selling pressure to sell (e.g. >= 1). If you're interested in more trading systems of the kind that operate in multiple time frames, explore the classic and [...]
[...] catches bullish divergences of Asymmetric RSI with price based on the 2nd approach. As seen on Figure 1, two potentially profitable opportunities could be taken as a result of timely signaling from the 14-period ARSI, which in its turn seems to be really responsive -- as much as the half-period RSI.
Figure 1. Illustrating on a long trade in OIH ETF, the ARSI turns out to signal two timely bullish divergence trades. Traders might like to explore the ARSI crossovers and crossunders, because the threshold levels are reached more timely than [...]
[...] you can now run full Exhaustive and Monte Carlo optimizations. A portfolio simulation ($5000 size, $8 1-way commissions) on the Dow 30 symbols over the last 6 years yielded the 2-Parameter optimization curve in Figure 1. Figure 1. While the optimization didn’t inspire confidence in the strategy’s stability over a wide range of parameters, ATR Factors around 2 helped improve the overall profit, while the Period did not affect the results significantly. WealthScript Code (C#)
using System;
using System.Collections.Generic;
using [...]
[...] portfolio backtest mode, you'll get a list of signals to buy on the open in the Alerts view as on Figure 1:
Figure 1. A view of the Alerts tab with 2 signals with the highest reading of the RS5 oscillator. If you wish to visualize the oscillators, double click on any trading signal. Wealth-Lab will plot them on a chart like Figure 2 illustrates:
Figure 2. A sample plot of the RS4 and RS5 oscillators built using author’s default set of 11 index funds on the daily chart of QQQ. Index fund data provided by Tiingo. On a closing note, simply [...]
[...] almost any entry style without adding prejudice. Entry rules Pullback entry: Buy at open next bar if the DMI Oscillator is above 0 and the DMI Stochastic crosses above 10. Short at open next bar if the DMI Oscillator is below 0 and the DMI Stochastic crosses below 90. Countertrend entry: Short at open next bar if the DMI Oscillator crosses under -20. Buy at open next bar if the DMI Oscillator crosses above 20.
Exit rules Fixed bars: exit at open next bar [...]
Syntax
public static int GetTime(this WealthScript obj, int bar)
public static int GetTime(this Bars bars, int bar) // For use when using a non-synchronized Bars object public int GetTime(int bar)
public int GetTime(Bars bars, int bar) // For use when using a non-synchronized Bars object
Parameter Description bar Bar number bars Bars object GetTime returns 24-hour time as an integer. Example: 4pm = 1600
Syntax [...]
[...] paramExitDays;
public ARSI_Divergence()
{
paramPeriod = CreateParameter("ARSI period", 14, 1, 100, 1);
paramHighest = CreateParameter("Highest high of", 20, 5, 50, 1);
paramExitDays = CreateParameter("Exit after", 20, 1, 50, 1);
}
protected override void Execute()
{
bool trough = false; int troughBar = -1;
int low = paramHighest.ValueInt;
int period = paramPeriod.ValueInt;
int days = paramExitDays.ValueInt;
ARSI [...]