Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

if statement

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

    if statement

    does anyone know why I would get an error on this if statement?

    int x = 0;

    if( todaySAR >= High[0])
    { (x ==
    1);
    }
    else
    { (x ==
    0);
    }

    thanks

    #2
    Try x=1 and x=0.
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #3
      that did it. NT did not like the parentheses

      Comment


        #4
        velocity,

        In general, == is a comparison operator not to be used for assignments. You are trying to assign a value to a variable here and that is why your code was having difficulties.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Renejm, Today, 06:17 AM
        0 responses
        3 views
        0 likes
        Last Post Renejm
        by Renejm
         
        Started by kazisl, Yesterday, 06:41 PM
        2 responses
        9 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by impactX, 05-04-2021, 01:07 AM
        1 response
        6 views
        0 likes
        Last Post Lancer
        by Lancer
         
        Started by op1031, Yesterday, 05:51 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by aaadetos, 05-04-2021, 09:28 AM
        2 responses
        10 views
        0 likes
        Last Post aaadetos  
        Working...
        X