Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Logic Formatting Question

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

    Logic Formatting Question

    Hello,

    I'm looking for a simpler way to do a test:

    If K had a value of less than 10 either one, two or three bars ago.

    (K[1] < 10) will test for one bar ago. Then using an OR statement (K[2] < 10) will test for two bars ago, etc. is what I have programmed in right now.

    Is there a way to put all three tests in one statement?

    Thanks,

    phoenix
    Last edited by phoenix; 01-16-2016, 01:49 PM.

    #2
    Hello phoenix,

    Thank you for writing in.

    You would be able to do the following:
    Code:
    // if K[1] OR K[2] OR K[3] had a value less than 10, do something
    if (K[1] < 10 || K[2] < 10 || K[3] < 10)
         // do something
    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Thanks Zachery_G

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      164 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      318 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      246 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      350 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X