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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        231 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        149 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        161 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        243 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        198 views
        0 likes
        Last Post CarlTrading  
        Working...
        X