Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MultiTime SMA PlotColor

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

    MultiTime SMA PlotColor

    Hi,

    I'm working on an indicator that plots values from indicators in secondary timeframes. I strated and simply plot the SMA vaues of 3, 10, and 30 min to a 5 min chart. Everything works fine and my next idea was to change the plot color with the Rising/Falling method.

    My problem is that the SMA of higher secondary timeframes keeps its value and thus is neither rising, nor falling. How can I code it to keep the last color used? Or define the color as a function of the Rising/Falling of the SMA in the secondary timeframe?

    #2
    Originally posted by marcoheimann View Post
    Hi,

    I'm working on an indicator that plots values from indicators in secondary timeframes. I strated and simply plot the SMA vaues of 3, 10, and 30 min to a 5 min chart. Everything works fine and my next idea was to change the plot color with the Rising/Falling method.

    My problem is that the SMA of higher secondary timeframes keeps its value and thus is neither rising, nor falling. How can I code it to keep the last color used? Or define the color as a function of the Rising/Falling of the SMA in the secondary timeframe?
    It would be easier to see what you have going on if you posted some sample code.

    In the NT Help Guide, does the Plots example help?

    NinjaScript > Language Reference > Indicator >Plots



    Examples
    // Initialize method of a custom indicator
    protected override void Initialize()
    {
    // Lines are added to the Lines collection in order
    Add(new Plot(Color.Orange, "Plot1")); // Stored in Plots[0]
    Add(new Plot(Color.Blue, "Plot2")); // Stored in Plots[1]
    }

    // Dynamically change the primary plot's color based on the indicator value
    protected override void OnBarUpdate()
    {
    if (Value[0] > 70)
    Plots[0].Pen = new Pen(Color.Blue);
    else
    Plots[0].Pen = new Pen(Color.Red);
    }

    Comment


      #3
      Originally posted by marcoheimann View Post
      Hi,

      I'm working on an indicator that plots values from indicators in secondary timeframes. I strated and simply plot the SMA vaues of 3, 10, and 30 min to a 5 min chart. Everything works fine and my next idea was to change the plot color with the Rising/Falling method.

      My problem is that the SMA of higher secondary timeframes keeps its value and thus is neither rising, nor falling. How can I code it to keep the last color used? Or define the color as a function of the Rising/Falling of the SMA in the secondary timeframe?
      Oh yeah, this looks like it has already been done, by photog53

      http://www.ninjatrader.com/support/f...atid=4&lpage=9

      Comment


        #4
        Hi sledge,

        Thanks for the link, I had made a quick search but didn't come across this indicator.

        You're right this is pretty much what I was trying to do, so I'll work with it.

        Thanks

        Marco

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Currandeny, Today, 05:32 AM
        0 responses
        1 view
        0 likes
        Last Post Currandeny  
        Started by pjsmith, Today, 01:00 AM
        1 response
        8 views
        0 likes
        Last Post NT-Roland  
        Started by alejandro888, Yesterday, 08:41 PM
        0 responses
        9 views
        0 likes
        Last Post alejandro888  
        Started by UltraNIX, Today, 02:14 AM
        0 responses
        5 views
        0 likes
        Last Post UltraNIX  
        Started by augustfay, Yesterday, 12:06 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Jason  
        Working...
        X