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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      118 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X