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 fredrikn, 05-08-2019, 04:01 AM
        57 responses
        4,389 views
        2 likes
        Last Post Momentum  
        Started by Blairski, Yesterday, 09:19 AM
        2 responses
        11 views
        0 likes
        Last Post Blairski  
        Started by tonynt, Today, 09:33 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by minotti1, Today, 08:31 AM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by SmartArtsStudio, 05-15-2021, 10:46 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X