Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# error i dont know where i going wrong it say identifer expected in line 281

C# error i dont know where i going wrong it say identifer expected in line 281

Scheduled Pinned Locked Moved C#
csharpgraphicstoolshelp
12 Posts 2 Posters 36 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J j k Nov2023

    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 types

    public 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
    
    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #2

    What is the exact error message?

    J 1 Reply Last reply
    0
    • L Lost User

      What is the exact error message?

      J Offline
      J Offline
      j k Nov2023
      wrote on last edited by
      #3

      cs1001 identifier expected its in line 201

      L 1 Reply Last reply
      0
      • J j k Nov2023

        cs1001 identifier expected its in line 201

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #4

        I cannot see anything obvious in lines 200/201 or 280/281 that would cause this. Are you sure there are no other messages?

        J 2 Replies Last reply
        0
        • L Lost User

          I cannot see anything obvious in lines 200/201 or 280/281 that would cause this. Are you sure there are no other messages?

          J Offline
          J Offline
          j k Nov2023
          wrote on last edited by
          #5

          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.(

          L 1 Reply Last reply
          0
          • L Lost User

            I cannot see anything obvious in lines 200/201 or 280/281 that would cause this. Are you sure there are no other messages?

            J Offline
            J Offline
            j k Nov2023
            wrote on last edited by
            #6

            im trying convert this Trading view code to C# l20d = low < ta.lowest(low,20)[1]

            1 Reply Last reply
            0
            • J j k Nov2023

              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.(

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #7

              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.

              J 1 Reply Last reply
              0
              • L Lost User

                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.

                J Offline
                J Offline
                j k Nov2023
                wrote on last edited by
                #8

                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

                L 1 Reply Last reply
                0
                • J j k Nov2023

                  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

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #9

                  Sorry I have no idea what that code is supposed to represent.

                  J 1 Reply Last reply
                  0
                  • L Lost User

                    Sorry I have no idea what that code is supposed to represent.

                    J Offline
                    J Offline
                    j k Nov2023
                    wrote on last edited by
                    #10

                    l20d = low < ta.lowest(low,20)[1] how to get this is c# that would be sufficient

                    L 1 Reply Last reply
                    0
                    • J j k Nov2023

                      l20d = low < ta.lowest(low,20)[1] how to get this is c# that would be sufficient

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #11

                      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.

                      J 1 Reply Last reply
                      0
                      • L Lost User

                        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.

                        J Offline
                        J Offline
                        j k Nov2023
                        wrote on last edited by
                        #12

                        thank you for the help , it is nice to have a platform like this.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups