Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop loss one tick below days open.

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

    Stop loss one tick below days open.

    Hi all,

    I am having some trouble getting a stop loss to work for the current strategy that i am working on.

    For the back testing i am trying to utilise a stop loss that will be one tick below the current days open and then for the same strategy run it for optimization using a percentage below the days open.

    I was just hoping some one could point out the correct code to use for the two situations.

    1 tick below
    PHP Code:
    SetStopLoss("long 1", CalculationMode.Price, CurrentDayOHL().CurrentOpen[0] - (1 * TickSize), false); 
    
    percentage below - this would be for 0.5% below - for the optimimization i would utilise (1 - variable) with the variable being 0.005 to 0.03.
    PHP Code:
    SetStopLoss("long 1", CalculationMode.Price, CurrentDayOHL().CurrentOpen[0] * 0.995, false); 
    
    many thanks for any help
    4blue

    #2
    4Blue, which issues are you seeing with those two code samples you posted? Have you check into your order behavior with enabled TraceOrders already?

    Comment


      #3
      hi bertrand

      thank you again for the response.

      I am still unsure what the problem was for the two stop loss conditions but the problem was remedied when I altered the price calculation for the stop loss price.

      4blue

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      647 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X