Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 mattbsea, Today, 05:44 PM
        0 responses
        3 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        31 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        2 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,282 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        20 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Working...
        X