Example with FlexRenko using Price based calculation of 1,0 Dollars.
Example with FlexRenko using ATR based calculation where ATR is weighted with a factor of 2,00.
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using WealthLab.ChartStyles.Community;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { //use these to change the settings for the Renko Chart: bool _Price = true; bool _ATR = false; double _Factor = 1; //**************************************************** //create an instance of FlexRenko FlexRenko fr = new FlexRenko(); //call the calculate Renkos Method fr.calculateRenkos(Bars,_Price, _ATR, _Factor); //get all the available Renko information in the Renko class stored for every bar Dictionary renkoDict = fr.getRenko(); //available variables in the Renko class are: /* public int firstBrickInBar; public int numBricks; public bool isDownBrick; public bool isUpBrick; public List brickHigh = new List(); public List brickLow = new List(); */ DataSeries brickHighSeries = new DataSeries(Bars, "brick High"); DataSeries brickLowSeries = new DataSeries(Bars, "brick Low"); double brickHigh = 0; double brickLow = 0; bool lastBrickUp = false; bool isUpBrick = false; bool isDownBrick = false; for(int bar = 1; bar <= Bars.Count - 1; bar++) { int numBricks = 0; int firstBrick = 0; int brickNumber; //get the current bar´s values from the renko dicitonary if(renkoDict.ContainsKey(bar)) { numBricks = renkoDictbar.numBricks; isUpBrick = renkoDictbar.isUpBrick; isDownBrick = renkoDictbar.isDownBrick; firstBrick = renkoDictbar.firstBrickInBar; } //draw the number of bricks to the chart if(numBricks > 0) AnnotateBar("#"+numBricks, bar, true, Color.Black); //paint the background according to current brick if(isUpBrick && !isDownBrick) lastBrickUp = true; else if(!isUpBrick && isDownBrick) lastBrickUp = false; if(lastBrickUp) SetPaneBackgroundColor(PricePane, bar, Color.LightGreen); else SetPaneBackgroundColor(PricePane, bar, Color.LightCoral); } PlotSeries(PricePane, brickHighSeries, Color.Green, WealthLab.LineStyle.Solid, 2); PlotSeries(PricePane, brickLowSeries, Color.Red, WealthLab.LineStyle.Solid, 2); } } }