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 NullPointStrategies, Today, 05:17 AM
      0 responses
      53 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X