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 MidenThur, Today, 12:52 AM
        0 responses
        3 views
        0 likes
        Last Post MidenThur  
        Started by seseoraf, Today, 12:51 AM
        0 responses
        2 views
        0 likes
        Last Post seseoraf  
        Started by Rosario, Today, 12:50 AM
        0 responses
        2 views
        0 likes
        Last Post Rosario
        by Rosario
         
        Started by kemoyums, Today, 12:38 AM
        0 responses
        2 views
        0 likes
        Last Post kemoyums  
        Started by MartynBashi, Yesterday, 11:01 PM
        0 responses
        4 views
        0 likes
        Last Post MartynBashi  
        Working...
        X