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 CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          474 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          315 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          253 views
          1 like
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          340 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          305 views
          0 likes
          Last Post CarlTrading  
          Working...
          X