Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily indicator, Minute Input Series (Beginner question)

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

    Daily indicator, Minute Input Series (Beginner question)

    Hi,

    i want to test some intraday strategies using the ATR indicator.


    However the ATR is based on the Input series but i want to have a daily ATR independent of the input series.

    Ok my idea was to use the the values of the PriorDayOHLC and adjust the Standard ATR indicator.

    I changed some stuff but it doesnt seem to work, even on the daily chart the graph looks similar but the absolute values are quite different.
    Attached Files

    #2
    Welcome to our forums - looking at your code you would then still take the averaging on the minute bars series, resulting in a much lower average being used than if you worked on a daily chart.

    You could add the daily / 1440 min series in the NinjaScript indicator and run your calculations on this added series - http://www.ninjatrader.com/support/h...nstruments.htm
    BertrandNinjaTrader Customer Service

    Comment


      #3
      thank you Bertrand,

      i created the ATRdaily indicator by adding the line of code.

      i implemented / found some code to use a fraction of the ATR as a stop loss, it seems to work on the long side but when short orders are executed they are instantly stopped out.
      Attached Files
      Last edited by markus1000; 01-26-2012, 01:25 PM.

      Comment


        #4
        Hi Markuss,

        Thank you for sharing the script. Likely this section is contributing.

        Code:
        if(Position.MarketPosition==MarketPosition.Flat)
        {
           SetStopLoss("",CalculationMode.Price,1,false);   
        }
        Since stop orders are sensitive to their value relative to market, this could work on the long side but not the short.

        It's good to use this style of resetting when flat, but you may want to change to mode ticks and choose a static value, so that the order would always be accepted no matter the market direction. Your dynamic controls for the order would take over right away so this initial placement will mainly go unnoticed.

        Code:
        if(Position.MarketPosition==MarketPosition.Flat)
        {
        SetStopLoss("",CalculationMode.Ticks, 20, false);   
        }
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          ok there still seems to be a problem with the ATR.

          Just as a reminder, i want to use the 5 day ATR (based on yesterdays closing price) as an indicator in a intraday strategy.

          OK i attached an screenshot with the indicator plotted on several timeframes

          Timeframes: 1min, 60 min and daily.

          Indicators:

          ATRday uses 420 minutes (RTH Session)
          ATRdaily uses 1140 min
          ATR is the standard Ninja indicator

          Charts: In a perfect world, the ATRdaily should print the same ATR value no matter what time frame

          TOP right and buttom right show the same dates, but the values are not similar


          The indicator isnt even accurate in the daily setting (looks like the ATRdaily is a lagged version of the orginal indictor)
          Attached Files

          Comment


            #6
            This custom indicator you're using is not developed by NinjaTrader, so unfortunately we can't comment on its expected values or comparisons with the standard ATR. If you've identified an indicator you would prefer to use rather than the custom one you found, there's nothing stopping you from using it in your strategy.

            If you have specific requirements on developing your strategy, you may consider discussing with one of our NinjaScript consultants, who can work with you to code to your exact specifications.
            http://www.ninjatrader.com/partners#...pt-Consultants
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              i want to use the standard 5 day ATR in an intraday strategy, a multitimeframe ATR so to speak. but it doesnt seem possible without changing the code

              Charting is not the problem, but that doesnt help when backtesting a strategy
              Last edited by markus1000; 01-27-2012, 01:20 PM.

              Comment


                #8
                You can add a daily series to your script, and then calculate 5 day ATR on this series.

                In Initialize():
                Code:
                Add(PeriodType.Day, 1);
                In OnBarUpdate()
                Code:
                double myATR = ATR(Closes[1], 5)[0];
                There is a sample multiseries script in all installation for reference on this. Click Tools > Edit NinjaScript > Strategy > SampleMultiTimeFrame.
                Ryan M.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by fredrikn, 05-08-2019, 04:01 AM
                57 responses
                4,390 views
                2 likes
                Last Post Momentum  
                Started by Blairski, Yesterday, 09:19 AM
                2 responses
                11 views
                0 likes
                Last Post Blairski  
                Started by tonynt, Today, 09:33 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by minotti1, Today, 08:31 AM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_Jim  
                Started by SmartArtsStudio, 05-15-2021, 10:46 AM
                1 response
                15 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X