Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is there a If or Else within the UI?

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

    Is there a If or Else within the UI?

    Hi, I'm trying to enter 2 contracts if ADX > 25 otherwise if ADX < 25 only enter 1. Is it possible to do this thru the UI?

    I'm not expert programmer, but here is what I'm trying to do below. If possible thru the UI is better because it seems as once I unlock the code, I can't go back to the UI.

    // Condition set 7
    if (Close[0] > Close[5]
    && ADX[0] > 25

    {
    EnterLong(Quantity2, "Order2");

    Otherwise,
    if (Close[0] > Close[5]
    && ADX[0] < 25

    EnterLong(Quantity1, "Order2");
    }

    #2
    Hi john_robertson00,

    Thanks for your note.

    You are headed in the right direction.

    If you are using the wizard you will want to put each of these as separate conditions.

    (I am assuming that Quantity1 is 1 and Quantity2 is 2)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I see. So what you are saying is that I can do something like:

      // Condition set 1
      if (Close[0] > Close[5]
      && ADX[0] < 25

      {
      EnterLong(Quantity1, "Order2");
      }

      // Condition set 2
      if (Close[0] > Close[5]
      && ADX[0] > 25

      {
      EnterLong(Quantity2, "Order2");
      }

      Comment


        #4
        Hello john_robertson00,

        That is correct.

        The wizard is not able to use OR. However, a separate condition would work the same way.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by dbennett3, Yesterday, 10:49 AM
        1 response
        20 views
        0 likes
        Last Post marcus2300  
        Started by Touch-Ups, Today, 08:42 AM
        0 responses
        9 views
        0 likes
        Last Post Touch-Ups  
        Started by obiwan_cashobi, Today, 05:50 AM
        0 responses
        12 views
        0 likes
        Last Post obiwan_cashobi  
        Started by janefoster, Yesterday, 11:50 PM
        0 responses
        8 views
        0 likes
        Last Post janefoster  
        Started by kaywai, 07-13-2024, 09:05 PM
        3 responses
        34 views
        0 likes
        Last Post kaywai
        by kaywai
         
        Working...
        X