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 pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        148 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,283 views
        0 likes
        Last Post Leafcutter  
        Working...
        X