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)

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by abelsheila, Yesterday, 07:38 PM
        0 responses
        5 views
        0 likes
        Last Post abelsheila  
        Started by nailz420, Yesterday, 09:14 AM
        1 response
        37 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by NinjaTrader_Brett, 05-12-2025, 03:19 PM
        0 responses
        260 views
        0 likes
        Last Post NinjaTrader_Brett  
        Started by domjabs, 05-12-2025, 01:55 PM
        2 responses
        56 views
        0 likes
        Last Post domjabs
        by domjabs
         
        Started by Morning Cup Of Trades, 05-12-2025, 11:50 AM
        1 response
        58 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Working...
        X