Announcement

Collapse
No announcement yet.

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.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    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.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by herzogvladimir2, Yesterday, 08:10 PM
        0 responses
        15 views
        0 likes
        Last Post herzogvladimir2  
        Started by giogio1, 04-13-2025, 01:42 AM
        2 responses
        40 views
        0 likes
        Last Post giogio1
        by giogio1
         
        Started by mmenigma, 01-23-2024, 09:37 AM
        1 response
        92 views
        0 likes
        Last Post Nin8aTrender  
        Started by wbayne333, 02-22-2021, 01:18 PM
        6 responses
        416 views
        0 likes
        Last Post Nin8aTrender  
        Started by gtheaded, 07-03-2020, 03:47 PM
        3 responses
        374 views
        0 likes
        Last Post Nin8aTrender  
        Working...
        X