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

Accessing the value of a slope indicator

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

    Accessing the value of a slope indicator

    Hello,
    I am trying to plot the slope of HoltEMA. I already have the slope and HoltEMA indicators. Both the indicators are attached.

    I want to achieve the following by either writing a brand new indicator or by adding a code snippet in existing Slope indicator.

    - Whenever the value of HoltEMA's slope is more than 5 bar color turns yellow and if less than -5, bar color turns blue

    I added the following code the existing slope indicator, but I am not able to accomplish what I want.

    if (PlotUp[0] >=5)
    {
    BarColor = Color.Yellow;
    }
    if (PlotDn[0] <=-5)
    {
    BarColor = Color.Blue;
    }

    Can someone please help me with what am I doing wrong here.
    Very much appreciate your help in advance.
    Attached Files

    #2
    pandyav, where exactly did you add that logic to color into the slope script? Testing the same setup I don't see any issue here, would perhaps help as well to mark up your levels on the slope via horizontal lines to see when the conditions should trigger for you.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Rapine Heihei, Today, 08:19 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    5 views
    0 likes
    Last Post Rapine Heihei  
    Started by f.saeidi, Today, 08:01 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 07:51 PM
    0 responses
    6 views
    0 likes
    Last Post Rapine Heihei  
    Started by frslvr, 04-11-2024, 07:26 AM
    5 responses
    98 views
    1 like
    Last Post caryc123  
    Working...
    X