⭐ aotegaoteg Posted April 17, 2023 Report Share Posted April 17, 2023 (edited) Hi, Anyone interested or can help in updating this simple indicator the indicator is meant to identify choppy ranges in x number of bars however it doesn't seem to plot this, any good C# edu can help in updating this indicator so it will identify choppy ranges, meaning if a Number of lookback bars, closes within the high or low range of the previous 5 bars plot these bar as red. additional, an NT8 conversion will be nice to have. superb cheersBar-Over-lap.zip Edited April 17, 2023 by aotegaoteg Quote Link to comment Share on other sites More sharing options...
⭐ AndyS Posted April 18, 2023 Report Share Posted April 18, 2023 Did you try asking ChatGPT? ⭐ aotegaoteg 1 Quote Link to comment Share on other sites More sharing options...
⭐ laser1000it Posted April 18, 2023 Report Share Posted April 18, 2023 Did you try asking ChatGPT? Andy do you think chatGPT is able to clean the dlls ? if you know how to do it please explain (from my side is impossible) Quote Link to comment Share on other sites More sharing options...
⭐ AndyS Posted April 18, 2023 Report Share Posted April 18, 2023 Andy do you think chatGPT is able to clean the dlls ? if you know how to do it please explain (from my side is impossible) I thought he was programing a new one with small errors. I don't think it can clean with GPT, but I have seen it correct few mistakes I had programing with EasyLanguage. Again, small stuff. But I hear the 4.0 is much better. I have not tried the 4/Plus yet. Quote Link to comment Share on other sites More sharing options...
⭐ aotegaoteg Posted April 18, 2023 Author Report Share Posted April 18, 2023 the files are .cs not dll Quote Link to comment Share on other sites More sharing options...
imfm Posted April 18, 2023 Report Share Posted April 18, 2023 what exactly do u need? version 7 cleaned or conversion to nt8 Quote Link to comment Share on other sites More sharing options...
⭐ laser1000it Posted April 19, 2023 Report Share Posted April 19, 2023 I thought he was programing a new one with small errors. I don't think it can clean with GPT, but I have seen it correct few mistakes I had programing with EasyLanguage. Again, small stuff. But I hear the 4.0 is much better. I have not tried the 4/Plus yet. I have 4Plus at now I don't see any difference (for my use) maybe more faster ⭐ AndyS 1 Quote Link to comment Share on other sites More sharing options...
⭐ aotegaoteg Posted April 19, 2023 Author Report Share Posted April 19, 2023 what exactly do u need? version 7 cleaned or conversion to nt8 version 7 cleaned, so it will identify choppy ranges, meaning if a Number of lookback bars, closes within the high or low range of the previous 5 bars plot these bar as red. Quote Link to comment Share on other sites More sharing options...
imfm Posted April 19, 2023 Report Share Posted April 19, 2023 enjoy! FULL NT8 COMPATIBLE #region Using declarations using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.SuperDom; using NinjaTrader.Gui.Tools; using NinjaTrader.Data; using NinjaTrader.NinjaScript; using NinjaTrader.Core.FloatingPoint; using NinjaTrader.NinjaScript.DrawingTools; using NinjaTrader.NinjaScript.Indicators; using System.Windows.Shapes; using NinjaTrader.Gui.Chart; using NinjaTrader.NinjaScript.DrawingTools; #endregion // This namespace holds all indicators and is required. Do not change it. namespace NinjaTrader.NinjaScript.Indicators { /// <summary> /// The bar overlap indicator counts the number of bars that overlap with the current bar's range. /// </summary> public class BarOverlap : Indicator { #region Variables private int period = 100; private double numStdDev = 2.0; private Brush baseColor = Brushes.SlateBlue; private Brush signalColor = Brushes.Red; private int plot0Width = 4; private PlotStyle plot0Style = PlotStyle.Bar; private DashStyleHelper dash0Style = DashStyleHelper.Solid; #endregion protected override void OnStateChange() { if (State == State.SetDefaults) { Description = "The bar overlap indicator counts the number of bars that overlap with the current bar's range."; Name = "BarOverlap"; AddPlot(new Stroke(baseColor, plot0Width), plot0Style, "Overlap"); IsOverlay = false; } else if (State == State.DataLoaded) { // SetPlotAppearance(Plots[0], baseColor, plot0Width, dash0Style); } } protected override void OnBarUpdate() { int n = 0; while (n < CurrentBar) { if (Low[0] >= High[n] || High[0] <= Low[n]) break; n = n + 1; } Value[0] = n; if (Value[0] > SMA(Value, period)[0] + numStdDev * StdDev(Value, period)[0]) PlotBrushes[0][0] = signalColor; else PlotBrushes[0][0] = baseColor; } private void SetPlotAppearance(Plot plot, Brush brush, int width, DashStyleHelper dashStyle) { plot.Pen = new Pen(brush, width) { DashStyle = DashStyleHelperToDashStyle(dashStyle) }; } private DashStyle DashStyleHelperToDashStyle(DashStyleHelper dashStyleHelper) { switch (dashStyleHelper) { case DashStyleHelper.Dash: return DashStyles.Dash; case DashStyleHelper.DashDot: return DashStyles.DashDot; case DashStyleHelper.DashDotDot: return DashStyles.DashDotDot; case DashStyleHelper.Dot: return DashStyles.Dot; case DashStyleHelper.Solid: return DashStyles.Solid; default: return DashStyles.Solid; } } protected override void OnRender(ChartControl chartControl, ChartScale chartScale) { base.OnRender(chartControl, chartScale); Plots[0].Pen = new Pen(baseColor, plot0Width) { DashStyle = DashStyleHelperToDashStyle(dash0Style) }; } #region Properties [browsable(false)] [XmlIgnore()] public Series<double> Overlap { get { return Values[0]; } } [NinjaScriptProperty] [Display(Name = "NumStdDev", GroupName = "NinjaScriptParameters", Order = 1)] public double NumStdDev { get { return numStdDev; } set { numStdDev = Math.Max(0, value); } } [NinjaScriptProperty] [Display(Name = "BaseColor", GroupName = "NinjaScriptParameters", Order = 2)] public Brush BaseColor { get { return baseColor; } set { baseColor = value; } } [NinjaScriptProperty] [Display(Name = "SignalColor", GroupName = "NinjaScriptParameters", Order = 3)] public Brush SignalColor { get { return signalColor; } set { signalColor = value; } } [NinjaScriptProperty] [Display(Name = "Plot0Width", GroupName = "NinjaScriptParameters", Order = 4)] public int Plot0Width { get { return plot0Width; } set { plot0Width = Math.Max(1, value); } } [NinjaScriptProperty] [Display(Name = "Plot0Style", GroupName = "NinjaScriptParameters", Order = 5)] public PlotStyle Plot0Style { get { return plot0Style; } set { plot0Style = value; } } [NinjaScriptProperty] [Display(Name = "Dash0Style", GroupName = "NinjaScriptParameters", Order = 6)] public DashStyleHelper Dash0Style { get { return dash0Style; } set { dash0Style = value; } } #endregion } } ⭐ AndyS, ⭐ aotegaoteg, GJTrader and 4 others 7 Quote Link to comment Share on other sites More sharing options...
⭐ aotegaoteg Posted April 20, 2023 Author Report Share Posted April 20, 2023 amazing work imfm Quote Link to comment Share on other sites More sharing options...
Obicanobi Posted April 21, 2023 Report Share Posted April 21, 2023 can someone explain how to compile the above code in nt8? Quote Link to comment Share on other sites More sharing options...
⭐ AndyS Posted April 21, 2023 Report Share Posted April 21, 2023 can someone explain how to compile the above code in nt8? Open one of the indicators and press F5 Quote Link to comment Share on other sites More sharing options...
Obicanobi Posted April 21, 2023 Report Share Posted April 21, 2023 can someone explain how to compile the above code in nt8? Open one of the indicators and press F5 yes once imported in nt8 will make sense what you said...my question was how to add the code into NT8? Quote Link to comment Share on other sites More sharing options...
⭐ AndyS Posted April 21, 2023 Report Share Posted April 21, 2023 yes once imported in nt8 will make sense what you said...my question was how to add the code into NT8? New--->NinjaScript Editor--> click on indicator, then new, then paste Obicanobi 1 Quote Link to comment Share on other sites More sharing options...
Obicanobi Posted April 22, 2023 Report Share Posted April 22, 2023 yes once imported in nt8 will make sense what you said...my question was how to add the code into NT8? New--->NinjaScript Editor--> click on indicator, then new, then paste thanks bro! ⭐ AndyS 1 Quote Link to comment Share on other sites More sharing options...
wahabdeen Posted April 23, 2023 Report Share Posted April 23, 2023 enjoy! FULL NT8 COMPATIBLE [ATTACH=JSON]{"data-align":"none","data-size":"full","title":"BAROVERLPA.jpg","data-attachmentid":810954}[/ATTACH] #region Using declarations using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.SuperDom; using NinjaTrader.Gui.Tools; using NinjaTrader.Data; using NinjaTrader.NinjaScript; using NinjaTrader.Core.FloatingPoint; using NinjaTrader.NinjaScript.DrawingTools; using NinjaTrader.NinjaScript.Indicators; using System.Windows.Shapes; using NinjaTrader.Gui.Chart; using NinjaTrader.NinjaScript.DrawingTools; #endregion // This namespace holds all indicators and is required. Do not change it. namespace NinjaTrader.NinjaScript.Indicators { /// <summary> /// The bar overlap indicator counts the number of bars that overlap with the current bar's range. /// </summary> public class BarOverlap : Indicator { #region Variables private int period = 100; private double numStdDev = 2.0; private Brush baseColor = Brushes.SlateBlue; private Brush signalColor = Brushes.Red; private int plot0Width = 4; private PlotStyle plot0Style = PlotStyle.Bar; private DashStyleHelper dash0Style = DashStyleHelper.Solid; #endregion protected override void OnStateChange() { if (State == State.SetDefaults) { Description = "The bar overlap indicator counts the number of bars that overlap with the current bar's range."; Name = "BarOverlap"; AddPlot(new Stroke(baseColor, plot0Width), plot0Style, "Overlap"); IsOverlay = false; } else if (State == State.DataLoaded) { // SetPlotAppearance(Plots[0], baseColor, plot0Width, dash0Style); } } protected override void OnBarUpdate() { int n = 0; while (n < CurrentBar) { if (Low[0] >= High[n] || High[0] <= Low[n]) break; n = n + 1; } Value[0] = n; if (Value[0] > SMA(Value, period)[0] + numStdDev * StdDev(Value, period)[0]) PlotBrushes[0][0] = signalColor; else PlotBrushes[0][0] = baseColor; } private void SetPlotAppearance(Plot plot, Brush brush, int width, DashStyleHelper dashStyle) { plot.Pen = new Pen(brush, width) { DashStyle = DashStyleHelperToDashStyle(dashStyle) }; } private DashStyle DashStyleHelperToDashStyle(DashStyleHelper dashStyleHelper) { switch (dashStyleHelper) { case DashStyleHelper.Dash: return DashStyles.Dash; case DashStyleHelper.DashDot: return DashStyles.DashDot; case DashStyleHelper.DashDotDot: return DashStyles.DashDotDot; case DashStyleHelper.Dot: return DashStyles.Dot; case DashStyleHelper.Solid: return DashStyles.Solid; default: return DashStyles.Solid; } } protected override void OnRender(ChartControl chartControl, ChartScale chartScale) { base.OnRender(chartControl, chartScale); Plots[0].Pen = new Pen(baseColor, plot0Width) { DashStyle = DashStyleHelperToDashStyle(dash0Style) }; } #region Properties [browsable(false)] [XmlIgnore()] public Series<double> Overlap { get { return Values[0]; } } [NinjaScriptProperty] [Display(Name = "NumStdDev", GroupName = "NinjaScriptParameters", Order = 1)] public double NumStdDev { get { return numStdDev; } set { numStdDev = Math.Max(0, value); } } [NinjaScriptProperty] [Display(Name = "BaseColor", GroupName = "NinjaScriptParameters", Order = 2)] public Brush BaseColor { get { return baseColor; } set { baseColor = value; } } [NinjaScriptProperty] [Display(Name = "SignalColor", GroupName = "NinjaScriptParameters", Order = 3)] public Brush SignalColor { get { return signalColor; } set { signalColor = value; } } [NinjaScriptProperty] [Display(Name = "Plot0Width", GroupName = "NinjaScriptParameters", Order = 4)] public int Plot0Width { get { return plot0Width; } set { plot0Width = Math.Max(1, value); } } [NinjaScriptProperty] [Display(Name = "Plot0Style", GroupName = "NinjaScriptParameters", Order = 5)] public PlotStyle Plot0Style { get { return plot0Style; } set { plot0Style = value; } } [NinjaScriptProperty] [Display(Name = "Dash0Style", GroupName = "NinjaScriptParameters", Order = 6)] public DashStyleHelper Dash0Style { get { return dash0Style; } set { dash0Style = value; } } #endregion } } Please share Barometer NT8 Thanks Quote Link to comment Share on other sites More sharing options...
Obicanobi Posted April 23, 2023 Report Share Posted April 23, 2023 enjoy! FULL NT8 COMPATIBLE [ATTACH=JSON]{"data-align":"none","data-size":"full","title":"BAROVERLPA.jpg","data-attachmentid":810954}[/ATTACH] #region Using declarations using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.SuperDom; using NinjaTrader.Gui.Tools; using NinjaTrader.Data; using NinjaTrader.NinjaScript; using NinjaTrader.Core.FloatingPoint; using NinjaTrader.NinjaScript.DrawingTools; using NinjaTrader.NinjaScript.Indicators; using System.Windows.Shapes; using NinjaTrader.Gui.Chart; using NinjaTrader.NinjaScript.DrawingTools; #endregion // This namespace holds all indicators and is required. Do not change it. namespace NinjaTrader.NinjaScript.Indicators { /// <summary> /// The bar overlap indicator counts the number of bars that overlap with the current bar's range. /// </summary> public class BarOverlap : Indicator { #region Variables private int period = 100; private double numStdDev = 2.0; private Brush baseColor = Brushes.SlateBlue; private Brush signalColor = Brushes.Red; private int plot0Width = 4; private PlotStyle plot0Style = PlotStyle.Bar; private DashStyleHelper dash0Style = DashStyleHelper.Solid; #endregion protected override void OnStateChange() { if (State == State.SetDefaults) { Description = "The bar overlap indicator counts the number of bars that overlap with the current bar's range."; Name = "BarOverlap"; AddPlot(new Stroke(baseColor, plot0Width), plot0Style, "Overlap"); IsOverlay = false; } else if (State == State.DataLoaded) { // SetPlotAppearance(Plots[0], baseColor, plot0Width, dash0Style); } } protected override void OnBarUpdate() { int n = 0; while (n < CurrentBar) { if (Low[0] >= High[n] || High[0] <= Low[n]) break; n = n + 1; } Value[0] = n; if (Value[0] > SMA(Value, period)[0] + numStdDev * StdDev(Value, period)[0]) PlotBrushes[0][0] = signalColor; else PlotBrushes[0][0] = baseColor; } private void SetPlotAppearance(Plot plot, Brush brush, int width, DashStyleHelper dashStyle) { plot.Pen = new Pen(brush, width) { DashStyle = DashStyleHelperToDashStyle(dashStyle) }; } private DashStyle DashStyleHelperToDashStyle(DashStyleHelper dashStyleHelper) { switch (dashStyleHelper) { case DashStyleHelper.Dash: return DashStyles.Dash; case DashStyleHelper.DashDot: return DashStyles.DashDot; case DashStyleHelper.DashDotDot: return DashStyles.DashDotDot; case DashStyleHelper.Dot: return DashStyles.Dot; case DashStyleHelper.Solid: return DashStyles.Solid; default: return DashStyles.Solid; } } protected override void OnRender(ChartControl chartControl, ChartScale chartScale) { base.OnRender(chartControl, chartScale); Plots[0].Pen = new Pen(baseColor, plot0Width) { DashStyle = DashStyleHelperToDashStyle(dash0Style) }; } #region Properties [browsable(false)] [XmlIgnore()] public Series<double> Overlap { get { return Values[0]; } } [NinjaScriptProperty] [Display(Name = "NumStdDev", GroupName = "NinjaScriptParameters", Order = 1)] public double NumStdDev { get { return numStdDev; } set { numStdDev = Math.Max(0, value); } } [NinjaScriptProperty] [Display(Name = "BaseColor", GroupName = "NinjaScriptParameters", Order = 2)] public Brush BaseColor { get { return baseColor; } set { baseColor = value; } } [NinjaScriptProperty] [Display(Name = "SignalColor", GroupName = "NinjaScriptParameters", Order = 3)] public Brush SignalColor { get { return signalColor; } set { signalColor = value; } } [NinjaScriptProperty] [Display(Name = "Plot0Width", GroupName = "NinjaScriptParameters", Order = 4)] public int Plot0Width { get { return plot0Width; } set { plot0Width = Math.Max(1, value); } } [NinjaScriptProperty] [Display(Name = "Plot0Style", GroupName = "NinjaScriptParameters", Order = 5)] public PlotStyle Plot0Style { get { return plot0Style; } set { plot0Style = value; } } [NinjaScriptProperty] [Display(Name = "Dash0Style", GroupName = "NinjaScriptParameters", Order = 6)] public DashStyleHelper Dash0Style { get { return dash0Style; } set { dash0Style = value; } } #endregion } } Please share Barometer NT8 Thanks any reason why i cannot see the indicator on ninjatrader 8 list to be added to the chart? Quote Link to comment Share on other sites More sharing options...
⭐ aotegaoteg Posted April 23, 2023 Author Report Share Posted April 23, 2023 (edited) This indicator is disappointing it doesn't indicate when the price is ranging or choppy, meaning if a Number of lookback bars, closes within the high or low range of the previous 5 bars, it doesn't plot the choppy range unless im reading this incorrectly @imfm can this be improved in the code? Edited April 23, 2023 by aotegaoteg Quote Link to comment Share on other sites More sharing options...
imfm Posted April 24, 2023 Report Share Posted April 24, 2023 This indicator is disappointing it doesn't indicate when the price is ranging or choppy, meaning if a Number of lookback bars, closes within the high or low range of the previous 5 bars, it doesn't plot the choppy range unless im reading this incorrectly @imfm can this be improved in the code? Yes, if you send me all directions and features clearly explained, I can do it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.