Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stoploss = 50% of the previous bar size.

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

    stoploss = 50% of the previous bar size.

    Good morning, can anyone think how to create in startegy builder the following logic:

    stoploss = 50% of the previous bar size.

    Thank you very much for possible ideas.​

    #2
    Hello micaeliglesias,

    When you say 50% of the bar size what specifically do you mean? Is that to place the order at the 50% price in the middle of the bar?

    Comment


      #3
      Hi Jess,
      I want to be able to automatically add a stop the size of half of the bar that just closed.
      i.e. if an entry condition is given and the bar that just closed is 10 ticks. i want the stop to be placed automatically at 5 ticks (half/(50%)).
      thanks
      (in startegy builder if possible)​

      Comment


        #4
        Hello micaeliglesias,

        If you are manually coding that type of math is possible. To get the previous bars difference in an amount of ticks you could use this equation:

        Code:
        double previousTicks = (High[1] - Low[1]) / TickSize;

        Comment


          #5
          Alternatively, you could set the stop loss to an exact price using one of the following:

          Code:
          double ExitPrice = (High[1] + Low[1]) / 2;
          gives the price that is the exact middle of the entire bar, or

          Code:
          double ExitPrice = (Open[1] + Close[1]) / 2;

          gives you the price which is the middle of the candle portion of the bar.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          87 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          132 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