Log in to see Cloud of Tags

Wealth-Lab Wiki

Search Engine

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.



Filter by Category

















This search, performed through 3.85 MB (775 documents, 11907 words), completed in 0.0 seconds and yielded 30 results.

Quandl provider suite — 3.9%

[...] randomColor; } protected override void Execute() { if( Bars.HasNamedDataSeries ) { ChartPane p = CreatePane( 100, true, true ); foreach( DataSeries ds in Bars.NamedSeries ) PlotSeries( p, ds, RandomColor(), LineStyle.Solid, 1 ); } else PrintDebug( Bars.Symbol + " does not contain named series" ); } } } CoT data by Quandl This example illustrates creation of a custom DataSeries from the COT Named Series data defined as Commercial Long - Commercial Short and then applying RSI indicator to the custom [...]

Interacting Dynamically with Portfolio Level Equity — 3.6%

[...] portfolio equity curve produces valid values! */ for(int bar = Bars.FirstActualBar; bar bar ) & ( p.Bars.Symbol == Bars.Symbol )) { #region User-configurable: Interacting with Portfolio Equity /* Your equity interaction rule goes here: */ if( globalEquity bar > globalEquity bar-100 ) { Position pos = u.entry( p, bar, p.EntrySignal, p.BasisPrice ); if( pos != null ) { pos.Priority = p.Priority; pos.EntrySignal [...]

TASC 2013-01 | The DMI Stochastic (Star) — 2.4%

[...] bar bar > 0 ? Color.DarkBlue : Color.Red ); if (IsLastPositionActive) { Position p = LastPosition; if( paramExitType.ValueInt == 0 ) // Fixed bars { if ( bar+1 - p.EntryBar >= FixedBars ) ExitAtMarket( bar+1, p, "Timed" ); } else { // Profitable/losing closes if( p.PositionType == PositionType.Long ) { if( Bars.Close bar > p.EntryPrice ) pBars++; else if( [...]

TASC 2016-04 | Trading Gap Reversals (Calhoun) — 2.3%

[...] 1; int cnt = 0; for (int bar = 1; bar bar .Date > Date bar-1 .Date ) cnt++; Position p = LastPosition; if (IsLastPositionActive) { double amount = p.MFEAsOfBar(bar) [...]

Intraday Support Functions — 1.9%

[...] second day loaded in the current chart. Syntax public static int DaysInPosition(this Position p, int bar) public int DaysInPosition(int bar) Parameter Description bar Bar number p Position object DaysInPosition returns how many trading days have passed since establishing a position using intraday data. Example: // Extension method syntax Position p = LastPosition; int days = p.DaysInPosition(bar); Description Intraday support functions and methods created [...]

TomorrowIsLastTradingDayOfWeek — 1.9%

[...] are purchased */ for(int bar = rsiPeriod * 3; bar = _profitPct.Value) SellAtMarket(bar + 1, p, "Profit"); else if (this.TomorrowIsLastTradingDayOfWeek(bar)) SellAtClose(bar + 1, p, "Friday"); } else { if (this.DateOfNextTradingDay(bar).DayOfWeek bar .DayOfWeek) { double pri = chase * RSI.Series(Close, rsiPeriod) bar ; Position p = BuyAtMarket(bar + 1, pri.ToString("0.000")); if (p != null) p.Priority [...]

TASC 2014-12 | Detecting Flags In Intraday Charts (Katsanos) — 1.9%

[...] Wealth-Lab 6 chart illustrating the detection of the flag pattern on a 5-minute chart chart of SPY (S&P 500 SPDR). With minimal tweaks to the system's parameters it can be applied to charts of different time frames (e.g. EOD): Figure 2. A failed flag on the Daily chart of AXP (American Express) in Wealth-Lab 6. There's room for improvement: consider adding a filter against erratic price movement, phase out the less probable trades against the medium-term (daily) trend, playing with the exits (to our taste, the initial stop at the flag bottom may result in premature [...]

TASC 2011-03 | Three-Bar Inside Bar Pattern (Prathap) — 1.7%

[...] double hi = High bar ; double lo = Low bar ; if (patternBars > 1) { int p = patternBars - 1; for (int n = bar - 1; n >= bar - p; n--) { hi = High n > hi ? High n : hi; lo = Low n n : lo; } } int b1 = bar - patternBars; int b2 = Math.Min(bar + 1, Bars.Count - 1); DrawPolygon(PricePane, color, color, LineStyle.Invisible, 1, true, b1, hi, b2, hi, b2, lo, b1, lo); } protected override void Execute() { Position p = null; double [...]

HV — 1.7%

[...] ) ShortAtMarket( bar+1 ); else BuyAtMarket( bar+1 ); } else { Position p = LastPosition; stop = (p.PositionType == PositionType.Long) ?

TASC 2020-06 | Correlation as a Cycle Indicator (Ehlers) — 1.7%

[...] (downTrend) SetBackgroundColor(bar, Color.FromArgb(30, Color.Red)); if (IsLastPositionActive) { Position p = LastPosition; if (!ExitAtStop(bar + 1, p, p.RiskStopLevel, string.Format("SL {0}%", stopLoss))) { if (p.PositionType == PositionType.Long) { switch (p.EntrySignal) { case "Breakout": if (downTrend) SellAtMarket(bar [...]

TASC 2014-06 | Slope Divergence: Capitalizing On Uncertainty (Kaufman) — 1.5%

[...] period, int momperiod, DataSeries ps, DataSeries ms, out bool trendup, out bool trenddn, out int p, out int m ) { trendup = (ps bar > 0 && ms bar > 0); trenddn = (ps bar bar bar >= 0 ? 1 : ps bar bar >= 0 ? 1 : ms bar bar > 0 && ms bar bar bar > 0 ) ? Side.Sell : Side.NA; } void Colorize( int bar, Side side ) { SetBackgroundColor( bar, Color.FromArgb(30, side == Side.Buy ? Color.Green : Color.Red ) ); } private StrategyParameter paramNumDiv; private StrategyParameter paramLongOnly; public TASC201406_Kaufman() { paramNumDiv [...]

Setting Priority for AtStop/AtLimit Orders — 1.5%

[...] data. LimitPriorityLong Syntax public static double LimitPriorityLong(this WealthScript ws, double p, int bar) public double LimitPriorityLong(double p, int bar) Parameter Description p Limit price bar Signal bar This function, created by Andrew Vishnyakov ( avishn ), helps to estimate which limit orders will realistically be hit first - without dropping to the intraday data level. According to its author, it gives quick and dirty approximation and is useful when scanning large data sets. IntradayFillPriorityEstimate [...]

Variance Ratio — 1.5%

[...] Color.Silver; VarianceRatio vr = VarianceRatio.Series(Bars, Close, 20, 400); double sensitivity = 0.9; ChartPane vr_p = CreatePane(30, true, false); PlotSeries(vr_p, vr, Color.Blue, ls, 1 ); DrawHorzLine(vr_p, sensitivity, Color.Red, ls, 2 ); RSI rsi_s = RSI.Series(Close, 14); ChartPane RSI_p [...]

TradingDaysBetweenDates — 1.5%

[...] -1; // no future fundamental item } if (IsLastPositionActive) { Position p = LastPosition; if (barsToNextEvent == 1) // Exit on day before ex-div { SellAtClose(bar, p, "Ex-div"); } else { double Stop = p.EntryPrice * (1 - 15.00 / 100.0d); SellAtStop(bar + 1, p, Stop, "Stop Loss"); } } else { if (barsToNextEvent > - 1 && barsToNextEvent Legacy syntax example: using System; using System.Collections.Generic; using [...]

Stop/Limit Orders — 1.5%

[...] price, string signalName) public static bool SellAtStopLimit(this WealthScript ws, int bar, Position p, double price) public static bool SellAtStopLimit(this WealthScript ws, int bar, Position p, double price, string signalName) public static bool CoverAtStopLimit(this WealthScript ws, int bar, Position p, double price) public static bool CoverAtStopLimit(this WealthScript ws, int bar, Position p, double price, string signalName) public Position BuyAtStopLimit(int bar, double price) public [...]

TASC 2003-01 | The Moving Trend (Rafter) — 1.5%

[...] Color.Gray, WealthLab.LineStyle.Solid, 1 ); for(int bar = 100; bar = 0; pos--) { Position p = ActivePositions pos ; if( p.PositionType == PositionType.Long ) { if( !SellAtStop( bar+1, p, [...]

ChandelierStop — 1.3%

Syntax public static double ChandelierStop(this Position p, Bars bars, int bar, int period, double coefficient ) public double ChandelierStop(Bars bars, int bar, Position p, int period, double coefficient ) Parameter Description p Position to apply Chandelier stop to period TR period for Chandelier stop calculation coefficient ATR factor for Chandelier stop calculation bars Bars object bar Bar number Description The Chandelier Stop is a trailing stop that is based on the volatility [...]

TASC 2011-05 | Volume Zone Oscillator (Khalil, Steckler) — 1.3%

[...] > 18 && Close bar bar ; bool osc = adx bar if (IsLastPositionActive) { Position p = LastPosition; if( p.PositionType == PositionType.Long ) { if( p.EntrySignal.ToLower().Contains("uptrend") ) { if( VZO bar > 60 && TurnDown( bar, VZO ) || ( Close bar bar && VZO bar bar bar bar > 40.0 ) { if( adx bar > 18 ) SellAtMarket( bar+1, p, "nontrend sell rule #1" ); } else { if( VZO bar bar bar > ema [...]

Intraday / Multi-Time Frame | Keep from holding positions overnight — 1.3%

[...] LastPosition, "Last Bar" ); } Or in a multiple open positions strategy that translates to: for(int p = ActivePositions.Count - 1; p >= 0; p--) { Position pos = ActivePositions p ; // exit on the last bar of the day if( Bars.IsLastBarOfDay(bar) ) 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 [...]

TASC 2013-10 | An Expert Of A System (Vervoort) — 1.3%

[...] bar > 0) ? Color.LightGreen : Color.Black ); if (IsLastPositionActive) { Position p = LastPosition; if( Close bar bar ) { double stopLoss = (1.0 - paramSL.Value / 100d); double stop = p.EntryPrice * stopLoss; double brkEven = p.EntryPrice * 1.01; if( CrossUnder( bar, tpEma, haEma ) ) //if( tpEma bar bar ) SellAtMarket( [...]

TASC 2011-06 | Entering The Price Zone (Khalil, Steckler) — 1.3%

[...] > 18 && Close bar bar ; bool osc = adx bar if (IsLastPositionActive) { Position p = LastPosition; if( p.PositionType == PositionType.Long ) { if( p.EntrySignal.ToLower().Contains("uptrend") ) { if( PZO bar > 60 && TurnDown( bar, PZO ) || ( Close bar bar && PZO bar bar bar bar > 40.0 ) { if( adx bar > 18 ) SellAtMarket( bar+1, p, "nontrend sell rule #1" ); } else { if( PZO bar bar bar > ema [...]

WealthScript Techniques | Portfolio-wide conditions — 1.1%

[...] false; // here's your "global" private bool SymbolIsActive(string sym) { foreach (Position p in ActivePositions) if( sym == p.Bars.Symbol ) return true; return false; } protected override void Execute() { for(int bar = 20; bar bar) continue; SMA sma = SMA.Series( Close, 20 ); if( CrossOver( bar, Close, sma ) ) BuyAtMarket( bar+1, "SMA CrossOver" ); } } RestoreContext(); // Exit [...]

Balancing PosSizer — 1.1%

[...] ); } holding++; } else if(holding >= holdingPeriod.ValueInt) { foreach(Position p in Positions) { if(p.Active) { SellAtMarket(bar [...]

TASC 2017-10 | A Candlestick Strategy With Soldiers And Crows (D'Ambrosio, Star) — 1.1%

[...] 50 ); bar bar - 1 >= 2; var overbot = (sto bar >= 80) || (rsi bar >= 70); double Stop = p.EntryPrice * (1 - paramSL.Value / 100d); double Profit = p.EntryPrice * (1 + paramTP.Value / 100.0d); if( twoLowerLows ) SellAtMarket( bar+1, p, "2 lows" ); else if( overbot ) SellAtMarket( [...]

PlotSymbolTrades — 1.1%

[...] WealthScript { protected override void Execute() { for(int bar = 40; bar bar ); else CoverAtStop( bar+1, p, Highest.Series( High,20 ) bar ); RestoreContext(); } else { SetContext( "KO", true ); Position p = BuyAtStop( bar+1, Highest.Series( High,40 ) bar ); if( p == null ) ShortAtStop( bar+1, Lowest.Series( Low,40 ) bar ); RestoreContext(); } } const string SymbolPair = "KO"; if( Bars.Symbol != SymbolPair ) { ChartPane pane = CreatePane( 100, false, [...]

NewMax — 1.1%

[...] ); NewMax new_low_s = NewMax.Series( Low,period ); // Graphics HideVolume(); ChartPane newm_p = CreatePane( 50, false, true ); SetPaneMinMax(newm_p, -100, 100); PlotSeries( newm_p, new_high_s, Color.Green, ls, 1 ); // New High PlotSeries( newm_p, new_low_s, Color.Red, ls, 1 ); // New Low // Trading for(int [...]

TASC 2013-03 | Camarilla Points (Bobrowski) — 1.1%

[...] Color.FromArgb(60,Color.Red) ); } } #endregion if (IsLastPositionActive) { Position p = LastPosition; if( lastBarToday ) ExitAtClose(bar, p, [...]

TASC 2009-02 | Trading the Aussie (Katsanos) — 1.1%

[...] * HH4 bar ; // should it be LL4 as in Buy? if( IsLastPositionActive ) { Position p = LastPosition; if( p.PositionType == PositionType.Long ) { if ( sht1 || sht2 || sht3 ) { SellAtClose(bar, p, "R:" + sht1 + "," + sht2 + "," + sht3 ); ShortAtClose(bar, "reverse"); } else if ( s1 || s2 || s3 ) SellAtClose(bar, p, "X:" + s1 + "," + s2 + "," + s3); } else if ( buy1 [...]

TASC 2016-10 | Which Trend Indicator Wins? (Katsanos) — 1.1%

[...] ADX.Series(obj.Bars,periodADX); var avgMAB = SMA.Series(c,mab); var adxLow = Lowest.Series(adx,adxLag); ChartPane p = obj.CreatePane(30,true,true); obj.PlotSeries(p, adx, Color.Red, LineStyle.Solid, 2 ); for(int bar = obj.GetTradingLoopStartBar(1); bar bar bar > avgMAB bar ) obj.BuyAtMarket(bar+1,"Strong Trend"); if( adx bar > adxMult * adxLow bar && obj.CrossOver(bar, adx, crit) & c bar > avgMAB bar ) obj.BuyAtMarket(bar+1,"Trend"); if( obj.CrossOver(bar, adx, adxTrend) && adx bar bar bar ) obj.ShortAtMarket(bar+1,"Strong [...]

TASC 2020-08 | The Compare Price Momentum Oscillator (CPMO) Part 1 (Apirine) — 0.9%

[...] author uses the CPMO to compare momentum of different indexes. For example, it's believed that the S&P 500 rises when consumer discretionary (IXY) outperforms consumer staples (IXR) and vice versa. As a reference we include a simplistic Strategy which produces buy signals when the PMO of IXY crosses above the PMO of IXR. The opposite event (a crossunder) generated a sell signal. Wealth-Lab users can find PMO in the Community Indicators library. Figure 1. On the daily chart, consumer discretionary (IXY) and consumer staples (IXR) are plotted along with the S&P [...]

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. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.