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

Problem With Indicator Plot

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

    Problem With Indicator Plot

    Hi,

    I created an indicator which appeared to plot fine on historical data. Today using it live it plots incorrect but if I reload the historical data on a chart live the false plots are removed and all is fine...

    I need the indicator to plot "calculate on bar close = false" and have it set to remove the plot live if conditions become not met on active bar.... Also, the indicator is programmed with two conditions met between two indicators both on the same time frame... The indicator is used on an MTF chart with the indicators on that chart loaded in the same time frame as the multi indicator I created to plot when their conditions are met... The main time frame used on the chart is the 5 minute with the indicators using the second hidden time frame of the 2 minute chart...

    Any ideas what would cause this to happen live but be corrected when historical data is reloaded? The indicators do not jump around at all, in other words at no point are conditions met to cause the plot to be correct...

    Thanks for any help,
    R.T.
    Last edited by tshirtdeal; 09-05-2012, 08:42 AM.

    #2
    R.T.

    I would need to see your code here. This type of thing is known as "repainting", and even if you do not access past values you may need to ensure things you are using internally don't do this as well, or that the data doesn't change between historical vs. real time.

    Who is your data provider?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hi Adam,

      Thanks for the reply... Data provider is IB... I have used a similar type code/indy for market analyzer which worked correctly. I copied or borrowed the main parts of this code from that idea... I know IB data can change bars when historical is reloaded, but this indicator does not move fast at all and the plots are way off...

      Here is the code... Thanks for any help

      Code:
      if (CurrentBar < 2)
                      return;
                  
                  double DesiredValue = (MEFLinRegAngle(60,14,3,9,3,false)[0] < 15 && MEFLinRegAngle(60,14,3,9,3,false)[0] > -15 && Low[1] <= Low[2] && Low [1] <= Low[0]) ? 1.0 : 0;
                  
                  if (DesiredValue == 1.0  && MASlopePlot(SlopePlotAverageType.EMA,SlopePlotType.NTS,30)[0] > 0)  DrawArrowUp(CurrentBar.ToString(), 0, Low[0] - (TickSize * 10), Color.Cyan);
                  if (DesiredValue == 0) RemoveDrawObject(CurrentBar.ToString());

      Comment


        #4
        TShirtDeal,

        IB doesn't offer historical tick data so this may partially explain your issue, i.e. lack of intrabar granularity. Another thing to note is that IB's ticks are filtered.

        You could try a supplementary data feed that offers unfiltered tick data both real time and historical, or you could also try using the setting Tools > Options > Data > Check "Save chart data as historical".

        If you want to try a supplementary feed, there are many available : http://www.ninjatrader.com/partners
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          thanks for the help Adam, sorry for the late reply... got busy...

          had another repaint issue on another chart indicator today and trying to figure this out... I am somewhat aware that IB's data changes , so if a data suppliers data changes it is filtered? Does the "Save chart data as historical". eliminate this problem as fare as say changing time frame on a chart and going back and seeing the chart has changed?

          Also last question, when IB's data changes does it change to the reality how what happened in real time I.E does it match unfiltered data historically? Just confused on this...

          Thanks,
          R.T.

          Comment


            #6
            tshirtdeal,

            The data is sort of like regular intervals of price updates from IB, to my knowledge they aren't unfilitered ticks such as raw data from the exchange. The price will match the markets at any given time however, note that IB does not provide historical tick data. In other words if you aren't receiving the ticks and saving it as historical data, you won't be able to download past tick data from IB. IB does offer real time tick data, just not historically saved tick data.

            Another thing to keep it mind is that if you are using time independent charts, such as Renko, range, tick, volume, etc. they are not set to a specific time scaling so they can change if you reload your charts.
            Adam P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by arvidvanstaey, Today, 02:19 PM
            4 responses
            10 views
            0 likes
            Last Post arvidvanstaey  
            Started by samish18, 04-17-2024, 08:57 AM
            16 responses
            56 views
            0 likes
            Last Post samish18  
            Started by jordanq2, Today, 03:10 PM
            2 responses
            8 views
            0 likes
            Last Post jordanq2  
            Started by traderqz, Today, 12:06 AM
            10 responses
            18 views
            0 likes
            Last Post traderqz  
            Started by algospoke, 04-17-2024, 06:40 PM
            5 responses
            47 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X