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

How to Condition an Indicator reading that post "n/a" as result

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

    How to Condition an Indicator reading that post "n/a" as result

    Is there a way with some indicators that post a value like 125.42 and you can condition for example: Close[0] > IndicatorX or IndicatorX > 0

    HOW DO YOU SAY IndicatorX is equal to n/a which is basically null is suppose

    Thanks

    #2
    Hello DTSSTS,

    Thanks for your post.

    I understand that you would like to create a condition in a strategy that compares an indicator to a numeric value or price value.

    You could set up a condition in the Conditions and Actions screen of the Strategy Builder and click the 'View code' button to view the syntax that makes up that condition.

    For example, you could set up a condition that checks if the current Close[0] price is greater than an indicator. You could also create a condition that checks if the indicator is greater than 0. Or, you could create a condition that checks if the indicator is equal to 0 (null).

    See this help guide page about creating indicator to value comparisons: https://ninjatrader.com/support/help...lueComparisons

    Conditions: https://ninjatrader.com/support/help...on_builder.htm
    Actions: https://ninjatrader.com/support/help...t8/actions.htm

    Also, see this publicly available training video, Strategy Builder 301, which goes over how to use the Strategy Builder to create NinjaScript strategies: https://www.youtube.com/watch?v=_KQF2Sv27oE&t=13s

    I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
    https://ninjatrader.com/support/help..._resources.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      SO n/a would be indicatorX = 0

      Comment


        #4
        Hello DTSSTS,

        Thanks for your note.

        You would not be able to check specifically if an indicator value is n/a, this typically means 'not available' meaning there is no value available.

        That said, null typically means a value of 0. So you could check if the indicator is equal to 0 (indicatorX == 0) if that suits your use case.

        Let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Nyman, Yesterday, 02:27 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Kdevineni, Today, 08:56 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Ndakotan1313, Today, 08:54 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by Alesiosc, Today, 08:43 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by shortrader, Today, 07:15 AM
        2 responses
        10 views
        0 likes
        Last Post shortrader  
        Working...
        X