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.
[...] Rule-based strategies The condition list for Date/Time only includes conditions for dates. How do I include a "time of the day" rule? Either use the "Intraday Rule: Time is later (earlier) than HHmm" in Community.Rules library or see a tip in the WealthScript section below. After generating strategy code with "View Strategy Code", there are strings like "Group1" and "Group1|". What do they mean? This is a string used to match up entries with exits. From the technical standpoint, the String.Contains( string ) method does the job here. Is it possible to add an ATR-based [...]
PosSizers (position sizing) I'm using 100% Equity position sizing and strategy doesn't seem to use all capital and/or there are trades not included due to insufficient capital. Also, when using 10% Equity on a portfolio of 10 stocks, same rules apply. The reason is that when Wealth-Lab determines the number of shares for an order, it does so with regard to the so called "basis price". For the whys and wherefores of it and specifically how this can cause skipped trades with trade sizes near 100% equity, refer to the User Guide: Strategy Window > Backtesting Strategies [...]
[...] '\t';
string s = "Date" + sep + "Open" + sep + "High" + sep + "Low" + sep + "SMA bar \n";
for(int i = sma.FirstValidValue; i i .ToShortDateString() + sep +
Open i + sep + High i + sep + Low i + sep + Close i +
sep + Bars.FormatValue( sma i ) + "\n" );
}
this.CopyText( s );
}
}
}
Advanced example
Copying formatted text and chart image to [...]
[...] bars
private void Highlighter( int[] array, double barsSince, int bar, Color color)
{
for( int i = 0; i i ) {
AnnotateBar(upArrow, bar, false, color, Color.Transparent, font);
AnnotateBar(array i .ToString(), bar, false, color, Color.Transparent, font2);
SetBarColor( bar, color );
break;
}
}
}
protected override void Execute()
{
// Variable definition, series creation and array initialization
PeakTroughMode pct = PeakTroughMode.Percent;
double [...]
[...] Capabilities
Does Wealth-Lab 6 support futures? Yes. Does Wealth-Lab 6 has specific Forex support i.e. bid/ask spread? To the extent that FX markets trade like futures, it's possible to perform FOREX simulations in Wealth-Lab, however, no special support exists for FOREX. Wealth-Lab 6 can backtest currency pairs as if they were futures. Please see this discussion regarding how to model the bid ask spread, and this KB article on configuring the program for Forex/futures: Working with Forex data . Does Wealth-Lab 6 have options support? Previously Wealth-Lab had [...]
[...] - 1 - howManyYearsToAverage; //Average price by year
var yearlyAverages = lstMonths.GroupBy(i => i.Year)
.Where(i => i.Key = yearFrom)
.Select(g => new { Year = g.Key, Average = g.Average(a => a.AvgPrice) }); var lstFreqUp = new Dictionary ();
var lstBreakdown = new Dictionary >(); //Calculate Monthly Adjusted Returns, Up Months and Frequency of Positive Returns
for (int month = 1; month foreach (var _m in lstMonths)
{
//Ensure [...]
[...] IRSTS123WaveRule()
{
if( ZigZags.Count > 0 )
{
ZigZags 0 .wave = Wave.W1;
for( int i = 1; i i - 1 ;
ZigZag w = ZigZags i ;
switch (prev.wave)
{
case Wave.W1:
if( i > 0 ) {
if( prev.isMoveUp ) { // W2 breaks down through W1's base = new W1 down
w.wave = ( w.outPrice prev.inPrice ) ? Wave.W1 : Wave.W2;
}
}
break;
case Wave.W2:
if( w.isMoveUp ) { // prev [...]
[...] for (int bar = GetTradingLoopStartBar(vixSma.FirstValidValue); bar bar >= 11 ) {
for( int i = bar; i > bar-11; i )
SetBackgroundColor( [...]
[...] bars.Low bar bar ) {
lstX.Add( new XEvent(bar, -1) );
}
}
for(int bar = 0; bar i ;
if( e.Bar == bar ) {
int prevEventBar = lstX i - 1 .Bar;
int step = bar-prevEventBar;
if( e.Type == 1 ) {
double Trough = Lowest.Value( bar, bars.Low, step );
e.Price = Trough;
e.Bar = (int)LowestBar.Value( bar, bars.Low, step );
}
else if( e.Type == -1 ) {
double Peak = Highest.Value( bar, bars.High, step );
e.Price = Peak;
e.Bar = (int)HighestBar.Value( [...]
[...] User Guide > Data on where the data are stored ; enable hidden file visibility in Windows).
How do I get a complete list of NYSE, Nasdaq, and AMEX symbols/tickers? They are built into Wealth-Lab's Yahoo! provider > "Create New DataSet" > Classification Groups. Whenever you need detailed information on tickers, contract specifications, etc., start by searching the official site of market where the product trades. Is it possible to edit stored data in Wealth-Lab 6? Yes. Double-click on a bar to edit it. Note that there also is a programmatic way that involves calling [...]
[...] connection string should include a database name. Your connection string must not include curly braces i.e. { } A rule of thumb is to first type in a connection string and only then proceed with selecting a provider. When you're finished with this step, the provider will populate the Table name dropdown box with the list of tables found. Select the one you need to make the provider fill the other boxes with available fields. Upon defining a field to serve as Security Name , the "Symbols" area is populated with found tickers. Note : when database contains thousands of [...]
[...] DownloadHistory(symbol, startDate, endDate);
}
catch { } if (bars != null)
{
for (int i [...]
[...] The second and succeeding moving averages are calculated according to this formula: PREVSUM = SMMA(i-1) *N
SMMA(i) = (PREVSUM-SMMA(i-1)+CLOSE(i))/N
Where:
SUM1 — is the total sum of closing prices for N periods;
PREVSUM — is the [...]
[...] missing Parameter Sliders when opened from the Home Page. Workaround: open the Strategy conventionally i.e. via "Open Strategy". (3844) Preferred Values cannot be saved for Strategy Libraries Strategy Monitor
(84581) SM may not find some symbols e.g. from other provider's DataSets or Index-Lab Workaround: Use GetExternalSymbol overload that accepts dataSetName : Bars idx = GetExternalSymbol("DataSet Name", "Index symbol", true); (98369) Strategy Monitor: Run Now Hangs Up with Intraday Data : an already Activated strategy hangs with "Run Once beginning..." after [...]
[...] )
ExitAtClose( bar, pos, "Last Bar" );
}
However, sometimes it gets more tricky. Read on below:
Problem
I'm trying to code an intraday strategy that doesn't hold any positions overnight. In order to do this I need to keep the buy limit order from being placed on the bar before the last bar of the day, since [...]
[...] StringSplitOptions.RemoveEmptyEntries); /* Parse the Put/Call Ratio data file starting from line 2 */
for ( int i = 3; i ">i"> t = lines[i .Split(',');
DateTime d = DateTime.ParseExact( t 0 , new string[] { "M/d/yyyy" }, format, DateTimeStyles.None [...]
[...] bar ;
bool avgVol = smaAvgVol bar >= 1000000;
bool surprise = false;
for(int i = fList.Count-1; i [...]
[...] that the usage of RSI or BB crossovers can be as multifaceted as to define pivot points. For example, I heard about a research some traders made that went as far as building synthetic price bars (like Renko) based on the RSI crossovers. Like a new Renko brick is drawn each time the close price exceeds a fixed amount, a new bar is created when an event like RSI crossover/crossunder takes place. While it may sound intriguing at first, a look into the code puts everything back in its place. Let's face it: in its present state, that's just tried and true crossovers and crossunders [...]
[...] double fourPi = 4 * Math.PI;
public class ArrayHolder
{ // current, old, older
internal double I, I2, I3;
internal double Q, Q2, Q3;
internal double R, R2, R3;
internal double Im, Im2, Im3;
internal double A;
internal double dB, dB2;
}
// Keep cntMax fifo samples and find the Highest and Lowest lead for samples in the list
private void PhaseList(ref ArrayList fifo, int cntMax, double lead, out double H, out double L)
{
H = lead; L = lead;
if( fifo.Count n ;
if( val > H ) H = val;
if( val ">61"> ah = new ArrayHolder[61 [...]
[...] there's one special case you should know. It happens when your ASCII (CSV) file contains empty fields ( i.e. ",,,," or empty line(s) ). The data provider treats them as null and will not continue parsing. As indicated in the User Guide, data fields can only contain numerical data, and they can't be null. In this case, the ASCII provider stops processing, and this is by design. The adapter's behavior can not be changed to create a non-existent value like "0" instead of what is there in the data (i.e. null ), because we feel that it's best to [...]
[...] But please don't be too hard on yourselves if this happens, because it's happened to the best of us. I've gone through this more times than I care to mention. Sometimes it was the fault of the software I was using, but most of the time it was my mistake. The general pattern is that you come across a set of rules that perform beautifully in most markets. You're absolutely amazed at the nice smooth slope of your equity curve, and the low drawdown. When you start to get feelings like this, be extra careful and scrutinize [...]
[...] override void Execute()
{
int t1 = param1.ValueInt;
int t2 = param2.ValueInt;
InSyncIndex i = InSyncIndex.Series( Bars );
ChartPane iPane = CreatePane( 30, true, false );
PlotSeries( iPane, i, Color.Blue, LineStyle.Solid, 1);
DrawHorzLine( iPane, t1, Color.Black, LineStyle.Dashed, 1 );
DrawHorzLine( iPane, t2, Color.Black, LineStyle.Dashed, 1 );
HideVolume(); [...]
[...] MyStrategy : WealthScript
{
public class ArrayHolder
{ // current, old, older
internal double I, I2, I3;
internal double Q, Q2, Q3;
internal double R, R2, R3;
internal double Im, Im2, Im3;
internal double A;
internal double dB;
}
public DataSeries CycleFilterDC(DataSeries ds, out DataSeries sine, out DataSeries cosine)
{
double twoPi = 2 * Math.PI;
// Initialize arrays
ArrayHolder ">51"> ah = new ArrayHolder[51 ;
for( int n = 8; n n = new ArrayHolder();
Color ">21"> color = new Color[21 ;
DataSeries ">51"> DB = [...]
[...] FundamentalsCheckerDemo : WealthScript
{
protected override void Execute()
{
ClearDebug();
// Let's say I want to check the "assets" data before I use it in a script
if(this.FundamentalSequenceCheck("assets") != -1)
{
// stop script processing now
return;
}
PrintDebug( "assets probably okay to use in script...");
}
}
}
Legacy syntax example:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using Community.Components; /*** Requires installation of Community.Components [...]
[...] you saved. How to Use It For me, setting optimization values has always been somewhat arbitrary. If I set the Stop value too low, one of the optimal parameters may be at the Stop value, and I have to set a new Stop value and run a new optimization. On the other end of the spectrum, if I set the Stop value too high, the optimization may run for a long time only to find that the optimal parameters were at or near the Start value. This optimizer makes the Stop values relatively unimportant, since it will stop the [...]
Traders' Tip text
I was busy with some programming project when this Tip article came in. As the trading idea by author Kent Calhoun looked so simple, it was a pleasure to take a break from coding and show our users how to get it done by example – this time without the need to write any code. Wealth-Lab's "Strategy From Rules" allows to produce a complete trading Strategy from building blocks known as Rules. To start, either choose "New Strategy from Rules" or strike Ctrl-Shift-R. Firstly, drag the "Buy at Stop Channel High" entry and set " Channel period " to 4. [...]
[...] uninstallation. Note that you can install or update multiple extensions and restart Wealth-Lab only once. How do I install Wealth-Lab extensions?
Click on «More Extensions on Wealth-Lab site» at the lower right corner of the application to open the Extensions page in your browser. Browse for available extensions. If you found an extension at the Wealth-Lab site that you'd like to install into Wealth-Lab 6, you will need to login first. Then click «Get...» to download the so-called wle file. A wle file is an encrypted bootstrapper file that contains an extension's details and its [...]
[...] (EUR) profit is found by dividing the forex profit by the exchange rate at the close of the trade, i.g., 1,000 USD/ 1.3300 = 751.88 EUR Sample Forex Trade: USD/CAD Again, ignoring leverage and commissions:
* Buy 1 lot of USD/CAD at 1.0400. This costs $100,000 * 1.0400 = 104,000 CAD
* Sell the lot at 1.0300. The lot is now worth $100,000 * 1.0300 = 103,000 CAD
* Profit (loss) on this trade = (1,000 CAD)
* In terms of the base currency (USD) profit is found by dividing the forex profit by the exchange rate at the close of the trade, [...]
The problem
"I am working on a day-trading strategy that operates on a portfolio of symbols. I would like to be able to read and write variables that operate across the entire portfolio, and are evaluated [...]
The problem
"How can I execute some code only once at the beginning or at the end of the process of backtesting on a dataset ? It could be useful for example to make an operation that must be done only once, like cleaning a database or opening a connection to a DB or calling an external process." The approach
Since Strategy execution starts on the first symbol (in alphabetical order) of the DataSet, i.e. DataSetSymbols[0] [...]