Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.PriceCurrentDayOHL().CurrentOpen[0] - (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.PriceCurrentDayOHL().CurrentOpen[0] * 0.995false); 
    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?

    BertrandNinjaTrader Customer Service

    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 cshox, Today, 11:11 AM
      0 responses
      2 views
      0 likes
      Last Post cshox
      by cshox
       
      Started by TAJTrades, Today, 11:03 AM
      0 responses
      3 views
      0 likes
      Last Post TAJTrades  
      Started by wuannetraam, Today, 02:40 AM
      3 responses
      25 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by jjs12, Today, 10:29 AM
      2 responses
      13 views
      0 likes
      Last Post jjs12
      by jjs12
       
      Started by Ludwik, Today, 03:52 AM
      7 responses
      32 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X