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

viewing charts on different timeframes in strategy analyser

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

    viewing charts on different timeframes in strategy analyser

    Hi,

    I need to run my strategy currently on high resolution bars it seems to get the correct price fills using the managed order handling in NT8. For example, if I use limit orders, and set stop losses if I run on 1 minute bars I don't get filled at the correct prices.
    I'm using "OnMarketData" to test for certain times of day, and entry signals then use EnterLongLimit(entryPrice), setStopLoss and SetProfit Target.

    I mention the above in case there is a better way to do this.

    In any case, I get the correct price fill/targets etc if I run the strategy in the Strategy analyser on 10 tick bars. If I run on 1 min bars I don't.

    The issue is that I want to be checking on the chart if my strategy, trailing stops, entries etc are all correct, and want to be viewing the entries marked and objects I draw on the 1 min or 5 min chart.

    How can I see this chart (eg 1min chart) from the SA for each instrument if I run on 10 tick data input??

    thanks

    #2
    Hello PolarBear,

    This would be achieved with intra-bar granularity by adding a secondary series to the script.

    Below is a link to a post about intra-bar granularity.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello PolarBear,

      This would be achieved with intra-bar granularity by adding a secondary series to the script.

      Below is a link to a post about intra-bar granularity.
      https://ninjatrader.com/support/foru...297#post491297
      thanks for the quick reply. Some comments:
      1) I already have 3 other dataseries added to my strategy (1 min, 2 min, 1 tick data). I added the tick data one for higher resolution already but it doesn't seem to have helped (see code below and #2 point):
      Code:
      // init
      				AddDataSeries(BarsPeriodType.Minute, 1);
      				AddDataSeries(BarsPeriodType.Minute, 2);	// add 2 minute data series
      				AddDataSeries(BarsPeriodType.Tick, 1);	// add tick data
      2) I do place my orders in the "OnMarketData" function as mentioned and checking: if (marketDataUpdate.MarketDataType == MarketDataType.Last). I don't use the OnBarUpdate() function for placing the order. I use the BarsInProgress variable to check for exit conditions of my trades for 1 and 2 min trails (hence the init dataseries additions above). Is this a problem?

      3) Other comments on the post you linked:
      a) Order fill resolution set to high -- this won't work as I'm running multiple instruments in the strategy analyser
      b) tick replay -- "TickReplay does not provide fill prices for accurate order fills"

      To re-iterate, my exits are filling accurate as I'm controlling this. My entry and exits set with limit order and setStopLoss are not.

      Comment


        #4
        Hello PolarBear,

        What BarsInProgress value is used for the order submission?

        May I see the line of code for the order submission?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello PolarBear,

          What BarsInProgress value is used for the order submission?

          May I see the line of code for the order submission?
          Thanks for the reply. I was able to get this to work. I had noticed in the strategy analyser when I set the input series to tick 1, the entries weren’t accurate. I played around a little and saw that if I ran tick 10 bars it was. Unsure if this is related to the number of ticks passing through if these are lower volume stocks or not.

          I changed the third data series I added from 1 to 10 tick and the entries were correct.

          Do you have any comment as to why altering it up to a higher resultion tick bar I would be getting this effect? Possibly something with the data?

          Thanks

          Comment


            #6
            Originally posted by NinjaTrader_ChelseaB View Post
            Hello PolarBear,

            What BarsInProgress value is used for the order submission?

            May I see the line of code for the order submission?
            Thanks for the reply. I was able to get this to work. I had noticed in the strategy analyser when I set the input series to tick 1, the entries weren’t accurate. I played around a little and saw that if I ran tick 10 bars it was. Unsure if this is related to the number of ticks passing through if these are lower volume stocks or not.

            I changed the third data series I added from 1 to 10 tick and the entries were correct.

            Do you have any comment as to why altering it up to a higher resultion tick bar I would be getting this effect? Possibly something with the data?

            Thanks

            Comment


              #7
              Hello PolarBear,

              I would expect 1 tick resolution to have higher accuracy than a 1 tick series.

              If an order is placed, it would fill with the first single tick with a valid price.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by trilliantrader, 04-18-2024, 08:16 AM
              4 responses
              18 views
              0 likes
              Last Post trilliantrader  
              Started by mgco4you, Today, 09:46 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by wzgy0920, Today, 09:53 PM
              0 responses
              9 views
              0 likes
              Last Post wzgy0920  
              Started by Rapine Heihei, Today, 08:19 PM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Rapine Heihei, Today, 08:25 PM
              0 responses
              10 views
              0 likes
              Last Post Rapine Heihei  
              Working...
              X