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 adjustment on daily bars

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

    Stop adjustment on daily bars

    I am running a strategy with EnterLongStop command and SetStopLoss command.
    I use Kinetick daily bars for backtesting.
    In case the Open is higher than the "stopPrice" my risk (entry price minus stoploss price) is higher that I had anticipated when I placed the order. When both entry and stoploss are triggered in a single daily bar, the loss I experience is higher than my risk appetite allows.
    I therefore want to adjust the "value" of the SetStopLoss command before the StopLoss is triggered in the same daily bar as where the order is triggered.
    Can this be done with daily bars?

    #2
    Hello,
    This would be possible in backtesting if you add in intrabar granularity to assist processing the data. Please see the following reference sample on backtesting with intrabar granularity: http://ninjatrader.com/support/forum...ead.php?t=6652. You will then be able to adjust the value for the stop loss value within the daily bar. You would need to check the values on the added series just as the reference sample does.
    If you are running this in real time you would not need to add intrabar granularity but would need to run the strategy with CalculateOnBarClose set to false.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Hi Cody,
      My backtest data consists of Daily Bars only (through Kinetick). When I add the command: Add("AXP",PeriodType.Minute, 1); my strategy suddenly shows no trades at all.
      (I add "AXP" as I am using the Add function already to add multiple instruments with PeriodType.Day,1).
      Are you sure the solution suggested works if I only have Daily Bars for test data?

      Comment


        #4
        Hello,
        In backtesting you will need to have tick data available to implement intrabar granularity. Backtesting this only on daily bars will not work. Are you using the Kinetick End of Day connection or are you using a live Kinetick subscription?
        Cody B.NinjaTrader Customer Service

        Comment


          #5
          I am using Kinetick EOD connection. Is there any way to adjust the SetStopLoss on the same Daily Bar after the EnterLongStop is triggered?

          Comment


            #6
            Hello,
            This would not be possible with using a connection that only supports daily data. To use intrabar granularity you will need to be able to receive tick data. This would only be possible with backtesting if you implement intrabar granularity.
            Cody B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by RubenCazorla, 08-30-2022, 06:36 AM
            3 responses
            77 views
            0 likes
            Last Post PaulMohn  
            Started by f.saeidi, Yesterday, 12:14 PM
            9 responses
            23 views
            0 likes
            Last Post f.saeidi  
            Started by Tim-c, Today, 03:54 AM
            0 responses
            3 views
            0 likes
            Last Post Tim-c
            by Tim-c
             
            Started by FrancisMorro, Today, 03:24 AM
            0 responses
            4 views
            0 likes
            Last Post FrancisMorro  
            Started by Segwin, 05-07-2018, 02:15 PM
            10 responses
            1,772 views
            0 likes
            Last Post Leafcutter  
            Working...
            X