Is there a simple way to plot a LinRegChannel? I haven't been able to figure one out.
In WL6 it literally took just 2 lines of code.
In WL6 it literally took just 2 lines of code.
Rename
Sure there is. The code that plotted it is open source, you can obtain it from the legacy Wiki:
http://www2.wealth-lab.com/WL5WIKI/CommunityComponentsMain.ashx
http://www2.wealth-lab.com/WL5WIKI/DrawLinRegChannel.ashx
It's just 4 lines of code which seems to be a no-brainer to translate to WL7. Once you've done with this we could include it in WL.Community.
http://www2.wealth-lab.com/WL5WIKI/CommunityComponentsMain.ashx
http://www2.wealth-lab.com/WL5WIKI/DrawLinRegChannel.ashx
It's just 4 lines of code which seems to be a no-brainer to translate to WL7. Once you've done with this we could include it in WL.Community.
I don't see the code, just the syntax & usage.
The first link contains the code, and to get it one has to log in to the Wiki. Since you don't appear to have an account, I'd sign you up there if you create a support ticket at wl6 website:
https://wl6.wealth-lab.com/Support/Create
https://wl6.wealth-lab.com/Support/Create
Ticket created, TIA.
I logged into Wiki but I still don't see any code to view or download.
Ok, d/l the code, found the relevant section... tried converting it to WL7 but it keeps crashing WL7, guess CosmeticExtensions are missing/obsolete. :(
OK added DrawLinRegChannel to WL.Community. Look forward to Build 10.
AWESOME11
Updated to b10. How do you plot this?
It's in WealthLab.Community namespace with syntax similar to WL6:
CODE:
public static void DrawLinRegChannel(this UserStrategyBase obj, int bar, TimeSeries series, int period, double width, Color color, PlotStyles style, int line)
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Drawing; using System.Collections.Generic; using WealthLab.Community; namespace WealthScript1 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { Color col = new Color(); if (idx > 50) { if (bars.Close[idx] > bars.Close[idx - 50]) col = Color.Green; else col = Color.Red; } this.DrawLinRegChannel(idx, bars.AveragePriceHL, 45, 2, Color.FromArgb(30, col), PlotStyles.Line, 1); } //declare private variables below } }
👍👍
Your Response
Post
Edit Post
Login is required