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

SMA Overlay's

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

    SMA Overlay's

    Hi,

    Have a few different SMA's on an indicator and I want to make sure they layed on top on each over in the correct order.

    SMA's are 200,50,12


    I want the 50 SMA to be under the 200 and 12. At the moment its a random thing when I load onto a chart.

    Code is as follows......

    protectedoverridevoid Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.CornflowerBlu e), PlotStyle.Line, "Plot12"));
    Add(
    new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "Plot50"));
    Add(
    new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot200"));

    Overlay =
    true;

    CalculateOnBarClose=
    false;
    }


    protectedoverridevoid OnBarUpdate()
    {




    Plot12.Set(SMA(period12)[
    0]);

    Plot50.Set(SMA(period50)[
    0]);


    Plot200.Set(SMA(period200)[
    0]);





    }


    Can I overlay the 200 and 12 over the 50 SMA?



    Thanks
    Bruce

    #2
    Bruce, the plots ZOrder could unfortunately not be set per plot, only per indicator. It would be therefore easiest if you add the SMA indicator 3 times with your desired settings and then change the ZOrder as needed with those instructions here : http://www.ninjatrader.com/support/m...rt-Z-Order.htm

    Then save this setup in a workspace file for future use.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Ok..thanks. Got it sorted out now.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Max238, Today, 01:28 AM
      4 responses
      35 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by r68cervera, Today, 05:29 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by geddyisodin, Today, 05:20 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by timko, Today, 06:45 AM
      2 responses
      14 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by habeebft, Today, 07:27 AM
      0 responses
      7 views
      0 likes
      Last Post habeebft  
      Working...
      X