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

My strategy needs to access a 2 plots of an indicator

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

    My strategy needs to access a 2 plots of an indicator

    How do I access the current value of the DM() ADX plot?

    I get compile error when I say:

    a = DM(3).+DM[0]

    also this doesn't work

    a = DM(3).Plot0[0] // (order of Plots is +Dm ADX -DM)

    HELP!

    another thread you said to do this to access a plot value,:

    So for your code, you could set a single plot to whatever values you want, and then look for those values in your strategy.
    Code:
    if (myIndicator(...).Plot0[0] == 1)
    // enter long
    ---------------

    Is "Plot0" just actual Plot name in the indicator ie not really "Plot0"

    I am using the DM() indicator.
    It has 3 plots +DM ADX and -DM this is the listed order
    Here is a cappture of indicator properties:



    If I say
    a = DM(3).+DM[0]

    I don't think +DM is a valid name in C#
    So what name do I use

    Error say unexpected identifier

    Does C# have a way to show the properties?
    In VBA there was a properties box
    It says [+1 overload] when my cursor is over the indicator
    How do I know what the overloads are?

    What if I can't see the indicator code, how do I know the names of the plots

    is that the same as getting +DM plot?

    #2
    Hello dcmdp,

    Plot components of DM indicator are accessed with:

    double dmDefault = DM(3)[0];
    double dmDiPlus = DM(3).DiPlus[0];
    double dmDiMinus = DM(3).DiMinus[0];

    The easiest way to identify correct syntax for multi-plot indicators is with the strategy wizard. You can select from the available plots in the gui. This help guide article can walk you through this:
    How to compare plot values of multi-plot indicators

    You don't reference Plot0 unless the indicator has this named as the plot. When you create indicator scripts through the wizard, this is the default first plot and why it was likely used in an example.

    Please see here for help working with intellisense in NinjaScript.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Austiner87, Today, 03:42 PM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by cshox, Today, 11:11 AM
    2 responses
    15 views
    0 likes
    Last Post cshox
    by cshox
     
    Started by algospoke, Today, 06:53 PM
    0 responses
    9 views
    0 likes
    Last Post algospoke  
    Started by mlprice12, 12-21-2021, 04:55 PM
    3 responses
    296 views
    0 likes
    Last Post paypachaysa  
    Started by lorem, 04-25-2024, 09:18 AM
    20 responses
    86 views
    0 likes
    Last Post lorem
    by lorem
     
    Working...
    X