Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to combine " if any" and 'if all in one condition in strategy builder

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

    How to combine " if any" and 'if all in one condition in strategy builder

    Dear Team,
    question1:

    I want to set a condition in strategy builder:
    if (Position.MarketPosition = MarketPosition.Short)
    {

    if(CrossAbove(MACD(12, 26, 9).Default, MACD(12, 26, 9).Avg, 3) || loss>10 )

    {
    Exit short;
    }

    }

    Since there is only if any and if all ,but how to combine them?

    question2:

    I want to set separate value of stop loss to long and short,but in strategy builder ,it seems that I can only set the same stop loss to long and short at the same time.
    Is any good way to solve this issue?

    Thank you very much!
    Last edited by williamzz; 07-03-2019, 03:26 PM.

    #2
    Hello williamzz, thanks for your note.

    You can make a group for your second conditional. In the set, first make this statement: if (Position.MarketPosition = MarketPosition.Short) and set it to if all

    Then add a group and set that group to "If any", then add these conditions to that group: if(CrossAbove(MACD(12, 26, 9).Default, MACD(12, 26, 9).Avg, 3) || loss>10 )

    On your second question: You must give your long and short orders unique signal names. Then you can make two pairs of stops and targets, one set for longs and the other for shorts. You will notice that the set stop loss and set profit target both take a signal name, match this up with the name you gave your orders.

    Kind regards.

    Comment


      #3
      Very helpful!
      Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      52 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X