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 CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        31 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        184 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        342 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        264 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X