- ago
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.
0
659
Solved
13 Replies

Reply

Bookmark

Sort
- ago
#1
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.
0
- ago
#2
I don't see the code, just the syntax & usage.
0
- ago
#3
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
0
- ago
#4
Ticket created, TIA.
1
- ago
#5
I logged into Wiki but I still don't see any code to view or download.
0
- ago
#6
http://www2.wealth-lab.com/WL5WIKI/CommunityComponentsMain.ashx
0
- ago
#7
Ok, d/l the code, found the relevant section... tried converting it to WL7 but it keeps crashing WL7, guess CosmeticExtensions are missing/obsolete. :(
0
- ago
#8
OK added DrawLinRegChannel to WL.Community. Look forward to Build 10.

3
- ago
#9
AWESOME11
0
- ago
#10
Updated to b10. How do you plot this?
0
- ago
#11
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)
0
- ago
#12
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    } }
0
Best Answer
- ago
#13
👍👍
0

Reply

Bookmark

Sort