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 NullPointStrategies, Today, 05:17 AM
          0 responses
          50 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X