Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calling SMA and EMA while interfacing Gui.NinjaScript.MarketAnalyzerColumnRenderBase

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

    Calling SMA and EMA while interfacing Gui.NinjaScript.MarketAnalyzerColumnRenderBase

    Hello, I hope someone can help me with this which I am trying to figure out for some time now. I'll be grateful if someone can point me to the right direction.

    I am writing a custom Market Analyzer Column script and I want to customize the column's color depending on its value so in my script, I am interfacing Gui.NinjaScript.MarketAnalyzerColumnRenderBase instead of the default MarketAnalyzerColumn to make color customizations in OnRender(). The problem is when I switch to this interface, I lose access to indicator functions like SMA, EMA and other built-in NinjaTrader functions in the body of my script particularly in OnBarUpdate().

    My question is: is there a way to access SMA(), EMA() and other NinjaTrader indicator functions while interfacing Gui.NinjaScript.MarketAnalyzerColumnRenderBase in a Market Analyzer Column? Many thanks in advance to whoever can help.

    #2
    Hello karlomacariola,

    I would suggest looking at the ChartNetChange column for some examples of how to access data when using OnRender in a column.

    You can still access all the same series or indicators but you need to change how you access their data. To access bar data you need to access the GetClose/Open/High/Low methods and supply an index, BarsAgo does not work in OnRender. The same concept applies to indicators you would need to use GetValueAt when accessing indicator values from OnRender.



    One other note is that you will also need IsDataSeriesRequired = true; in State.SetDefaults which is shown in ChartNetChange also.

    Comment


      #3
      Many thanks for sending me to the right direction and I'll definitely check this out.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X