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

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 DJ888, Yesterday, 06:09 PM
        2 responses
        9 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        40 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Today, 08:51 AM
        2 responses
        16 views
        0 likes
        Last Post bill2023  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        167 responses
        2,260 views
        0 likes
        Last Post jeronymite  
        Started by warreng86, 11-10-2020, 02:04 PM
        7 responses
        1,362 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X