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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          43 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          20 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          29 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          46 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          38 views
          0 likes
          Last Post CarlTrading  
          Working...
          X