C# error i dont know where i going wrong it say identifer expected in line 281
-
namespace ATAS.Indicators.Technical;
using ATAS.Indicators.Drawing;
using OFT.Localization;
using OFT.Rendering.Context;
using OFT.Rendering.Settings;
using OFT.Rendering.Tools;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Drawing;
using System.Runtime.Intrinsics.X86;
using Color = System.Drawing.Color;[DisplayName("Candle X")]
public class CandleStatist : Indicator
{
#region Nested typespublic enum LabelLocations { \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.AboveCandle))\] Top, \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.BelowCandle))\] Bottom, \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.ByCandleDirection))\] CandleDirection } #endregion #region Fields private readonly PenSettings \_bgPen = new() { Color = DefaultColors.Gray.Convert() }; private readonly BrushSettings \_bgBrush = new(); private readonly RenderStringFormat \_format = new() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center, }; private int \_backGroundTransparency = 8; const int X = 100; public double uhv; private double av; public double r; public double ar; public double uwrb; public double wrb; public double u3; public double m3; public double l20d; #endregion #region Properties #region Settings \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.LabelLocation), GroupName = nameof(Strings.Settings))\] public LabelLocations LabelLocation { get; set; } = LabelLocations.Top; \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.ShowVolume), GroupName = nameof(Strings.Settings))\] public bool ShowVolume { get; set; } = true; \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.ShowDelta), GroupName = nameof(Strings.Settings))\] public bool ShowDelta { get; set; } = true; \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.ClustersMode), GroupName = nameof(Strings.Settings))\] public bool ClusterModeOnly { get; set; } #endregion #region Visualization \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.Volume), GroupName = nameof(Strings.Visualization))\] public Color VolumeColor { get; set; } = De
-
namespace ATAS.Indicators.Technical;
using ATAS.Indicators.Drawing;
using OFT.Localization;
using OFT.Rendering.Context;
using OFT.Rendering.Settings;
using OFT.Rendering.Tools;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Drawing;
using System.Runtime.Intrinsics.X86;
using Color = System.Drawing.Color;[DisplayName("Candle X")]
public class CandleStatist : Indicator
{
#region Nested typespublic enum LabelLocations { \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.AboveCandle))\] Top, \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.BelowCandle))\] Bottom, \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.ByCandleDirection))\] CandleDirection } #endregion #region Fields private readonly PenSettings \_bgPen = new() { Color = DefaultColors.Gray.Convert() }; private readonly BrushSettings \_bgBrush = new(); private readonly RenderStringFormat \_format = new() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center, }; private int \_backGroundTransparency = 8; const int X = 100; public double uhv; private double av; public double r; public double ar; public double uwrb; public double wrb; public double u3; public double m3; public double l20d; #endregion #region Properties #region Settings \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.LabelLocation), GroupName = nameof(Strings.Settings))\] public LabelLocations LabelLocation { get; set; } = LabelLocations.Top; \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.ShowVolume), GroupName = nameof(Strings.Settings))\] public bool ShowVolume { get; set; } = true; \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.ShowDelta), GroupName = nameof(Strings.Settings))\] public bool ShowDelta { get; set; } = true; \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.ClustersMode), GroupName = nameof(Strings.Settings))\] public bool ClusterModeOnly { get; set; } #endregion #region Visualization \[Display(ResourceType = typeof(Strings), Name = nameof(Strings.Volume), GroupName = nameof(Strings.Visualization))\] public Color VolumeColor { get; set; } = De
-
cs1001 identifier expected its in line 201
-
cs1001 identifier expected its in line 201
-
I cannot see anything obvious in lines 200/201 or 280/281 that would cause this. Are you sure there are no other messages?
var prevCandle = GetCandle(bar-1); var l20d = (candle.Low) < prevCandle.(_lowestX.Calculate(20, candle.Low)); this is giving me cs1001: identifier expected. im not getting where to correct that @ start of parenthisis of prevCandle.(
-
I cannot see anything obvious in lines 200/201 or 280/281 that would cause this. Are you sure there are no other messages?
im trying convert this Trading view code to C# l20d = low < ta.lowest(low,20)[1]
-
var prevCandle = GetCandle(bar-1); var l20d = (candle.Low) < prevCandle.(_lowestX.Calculate(20, candle.Low)); this is giving me cs1001: identifier expected. im not getting where to correct that @ start of parenthisis of prevCandle.(
On line 201 you have the following:
var l20d = (candle.Low) < prevCandle.(_lowestX.Calculate(20, candle.Low));
^but the period character after
prevCandle
implies a reference to a Property or Method. But the following expression in parentheses is neither. -
On line 201 you have the following:
var l20d = (candle.Low) < prevCandle.(_lowestX.Calculate(20, candle.Low));
^but the period character after
prevCandle
implies a reference to a Property or Method. But the following expression in parentheses is neither.im a beginner, im trying edit it according to my condition,, can there be any solution //@version=5 indicator("VK", "Stop vol", overlay=true, max_bars_back = 500, max_boxes_count = 1000, max_lines_count = 250, max_labels_count = 500) X = input(10) av = (ta.sma(volume, X)) uhv = (volume > (2 * av)) r = high -low ar = ta.sma(r,X) uwrb = (r>(2*ar)) wrb = (r>(1.33*ar)) and (r<(2*ar)) u3 = close > (high-(r/3)) m3 = (close < (high - (r/3))) and (close > (low + (r/3))) l20d = low < ta.lowest(low,20)[1] sos = (close < close[1]) and ((volume > ta.highest(volume,3)[1] and l20d) or uhv) and (uwrb or wrb) and (m3 or u3) plotshape(sos, style=shape.xcross, location = location.belowbar ,color= #2ebd85 ,text= 'sv' ,textcolor= #2ebd85 , size = size.auto) this is compelte Tradingv iew code, im trying get l20d line
-
im a beginner, im trying edit it according to my condition,, can there be any solution //@version=5 indicator("VK", "Stop vol", overlay=true, max_bars_back = 500, max_boxes_count = 1000, max_lines_count = 250, max_labels_count = 500) X = input(10) av = (ta.sma(volume, X)) uhv = (volume > (2 * av)) r = high -low ar = ta.sma(r,X) uwrb = (r>(2*ar)) wrb = (r>(1.33*ar)) and (r<(2*ar)) u3 = close > (high-(r/3)) m3 = (close < (high - (r/3))) and (close > (low + (r/3))) l20d = low < ta.lowest(low,20)[1] sos = (close < close[1]) and ((volume > ta.highest(volume,3)[1] and l20d) or uhv) and (uwrb or wrb) and (m3 or u3) plotshape(sos, style=shape.xcross, location = location.belowbar ,color= #2ebd85 ,text= 'sv' ,textcolor= #2ebd85 , size = size.auto) this is compelte Tradingv iew code, im trying get l20d line
-
l20d = low < ta.lowest(low,20)[1] how to get this is c# that would be sufficient
-
l20d = low < ta.lowest(low,20)[1] how to get this is c# that would be sufficient
-
That is a valid expression in C#. But that does not mean it will work. You need to understand what each variable represents and what the resulting values are expected to be.
thank you for the help , it is nice to have a platform like this.