Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

'PlotObjects.Text' is a 'field' but is used like a 'type'

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    'PlotObjects.Text' is a 'field' but is used like a 'type'

    Hi,
    I have one indicator and using below in my code:


    private Dictionary<int, PlotObjects.Text> tsTextList;

    private Dictionary<int, PlotObjects.Line> tsLineList;

    When compile get this error:
    'PlotObjects.Text' is a 'field' but is used like a 'type'

    Hot to solve this?
    Regards,

    #2
    Hello RezaFx,
    You have to assign the type as the value. For example instead of using PlotObjects.Text if you use string then are you able to compile the code (assuming Test is a string variable).

    Code:
    private Dictionary<int, string> tsTextList;
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      PlotStyle Function

      Hi,
      In Ninja version 7, for PlotStyle we have below functions:
      PlotStyle.Bar
      PlotStyle.Block
      PlotStyle.Cross
      PlotStyle.Dot
      PlotStyle.Hash
      PlotStyle.HLine
      PlotStyle.Line
      PlotStyle.Square
      PlotStyle.TriangleDown
      PlotStyle.TriangleUp

      I have one one code for older Ninja and it used integer number for PoltStyle.
      Add(new Plot(new Pen(Color.Red, 5f), 3, "MyValue"));

      Here PlotStyle is 3, What is equivalent for that? PlotStyle.Cross or PlotStyle.Bar, or other?
      Any reference for this numbers and plotstyle?
      Regards,

      Comment


        #4
        Hello RezaFx,
        3 will be PlotStyle.Dot.

        You can use the below code to find out the various enum values for the correspondent integers.

        Code:
        PlotStyle ps = (PlotStyle)3;
        Print("Plot Style = " + ps.ToString());
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        571 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X