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 judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        57 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        20 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        9 views
        0 likes
        Last Post cre8able  
        Working...
        X