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

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

      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 Javierw.ok, Today, 04:12 PM
        0 responses
        4 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        40 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X