Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How a Add an OR to True False Conditions

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

    How a Add an OR to True False Conditions

    TrendingLong[0] = plotH1[0]>plotH2[0] ? 1 : 0;

    the above is correct and works as expected. Plots 1 when True and 0 when False

    I wish to have additional condition separate from this one also create the 1 for True as well NOT SURE OF THE SYNTAX FOR THAT

    Basic is this

    TrendingLong[0] = plotH1[0]>plotH2[0], OR plotH2[0]>plotH3[0] AND plotL1[0]>plotL2[0] ? 1 : 0;

    I AM SURE NO "OR" or "AND" but need commas and parenthesis in some form

    Thanks

    #2
    Hello DTSSTS,

    Thank you for your reply.

    Or would be written as ||, and && would be and, so:

    TrendingLong[0] = plotH1[0]>plotH2[0] || (plotH2[0]>plotH3[0] && plotL1[0]>plotL2[0]) ? 1 : 0;

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Thanks , been a while since I looked at Open code

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X