Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator openprice - currentprice = xPrice

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

    Indicator openprice - currentprice = xPrice

    Hi,
    Need help with programming indicator in Market Analyzer. I want to have xPrice values in column:

    OPEN_PRICE - CURRENT_PRICE = xPrice

    I do not know how to make it in Market Analyzer. I have checked many indicators source codes. I am programming many years. Please let me know.

    Bob

    #2
    Hello Freelancerbob,

    Thank you for your note.

    To make values calculated in your indicator available for display in the market analyzer column, you should reference the SMA indicator preloaded on NinjaTrader. This demonstrates setting a calculated value to a plot, which the MA can reference.

    To add a column to market analyzer which will display this value, right click on the market analyzer window>columns>then click Add and select your indicator.

    See our Helpguide on How to Add columns:

    NT7: http://ninjatrader.com/support/helpG...th_columns.htm
    NT8: http://ninjatrader.com/support/helpG...th_columns.htm

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_AlanP View Post
      Hello Freelancerbob,

      Thank you for your note.

      To make values calculated in your indicator available for display in the market analyzer column, you should reference the SMA indicator preloaded on NinjaTrader. This demonstrates setting a calculated value to a plot, which the MA can reference.

      To add a column to market analyzer which will display this value, right click on the market analyzer window>columns>then click Add and select your indicator.

      See our Helpguide on How to Add columns:

      NT7: http://ninjatrader.com/support/helpG...th_columns.htm
      NT8: http://ninjatrader.com/support/helpG...th_columns.htm

      Please let us know if you need further assistance.
      Thanks, but i know how to add column with my indicator into market analyzer. I do not know how to create it, i need to understand structure of code. SMA is not what i need but maybe i can start there by reading source code.

      Comment


        #4
        Hello Freelancerbob,

        You'll see in the SMA indicator, a plot is created and the value of the plot is set. This plot value is what the market analyzer can display.

        I've highlighted the important pieces in NT7 and NT8.

        NT7:

        Add(new Plot(Color.Orange, "SMA"));

        Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));

        NT8:

        AddPlot(Brushes.Goldenrod, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meSMA);

        Value[0] = (last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period);

        Please see Plots section of our Helpguide;

        NT7 http://ninjatrader.com/support/helpG...nt7/?plots.htm
        NT8 https://ninjatrader.com/support/help...-us/?plots.htm

        Value Section of our helpguide;

        NT7 http://ninjatrader.com/support/helpG...nt7/?value.htm
        NT8 https://ninjatrader.com/support/help...-us/?value.htm

        With the Strategy Wizard you can setup conditions and variables and then see the generated code in the NinjaScript Editor by clicking the View Code button. Setting the value of a plot within the builder, then viewing code would allow you to see how the plot is set and what you'd need to do to make a value available in the market analyzer.

        Strategy Wizard 301 - https://www.youtube.com/watch?v=FmBi...56536A44DD7105
        NinjaScript Editor 401 - https://www.youtube.com/watch?v=K8v_...56536A44DD7105

        Please let us know if you need further assistance.
        Last edited by NinjaTrader_AlanP; 01-11-2017, 03:30 PM.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sjsj2732, 03-23-2026, 04:31 AM
        0 responses
        77 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        313 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        314 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        149 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        114 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X