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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      65 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X