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 cmoran13, Yesterday, 01:02 PM
      0 responses
      29 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      21 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      160 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      95 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      148 views
      2 likes
      Last Post CaptainJack  
      Working...
      X