Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Charting data problem

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

    Charting data problem

    Hello,

    I'm trying to load up my charts for my CL 12-10. GC 12-10, TF 12-10 and i'm having problems.

    I'm using esignal for my data.

    The last data for all the charts appear to be 17:14 on 29 october 2010. Although i'm getting ticks thru my time and sales window, i'm unable to get the chart reloaded.

    I've tried reloading historical data, i've already deleted the Ninjatrader MDB file and also repair DB. What else can i do?

    Thanks.

    #2
    Hello pehon,

    Thank you for your post.

    • What session begin & end times do you have set in the Chart Properties?
    • What version of eSignal do you currently have installed?
    • Does this same issue occur on a brand new chart without indicators or custom templates?
    • Besides TF, GC, & CL – does this happen with any other instruments?
    ChipNinjaTrader Customer Service

    Comment


      #3
      Problem charting indicator with custom user-defined dataseries

      I am trying to use the EMA indicator within my strategy to plot the average bar price, rather than the close. To do this I've created my own data series and passed this to the EMA class. Here are some code snippets from my strategy to do this:

      public class MyStrategy : Strategy
      {
      #region Variables

      private DataSeries avgBarSeries;
      private IndicatorBase fastEMA;

      ...

      protected override void Initialize()
      {
      CalculateOnBarClose = true;

      this.avgBarSeries = new Dataseries(this);

      this.fastEMA = EMA(this.avgBarSeries,FastPeriod);
      this.fastEMA.Overlay = true;
      this.fastEMA.Plots[0].Pen.Color = Color.Blue;
      this.Add(this.fastEMA);

      ...

      protected override void OnBarUpdate()
      {
      double avgBarPrice = (Open[0] + High[0] + Low[0] + Close[0]) / 4.0;

      this.avgBarSeries.Set(avgBarPrice);

      ...

      In my backtest I used ES 06-11 (15-min bars) and pulled in data going back to 1/1/2008 for the primary session only (8:30am - 3:15pm CT). If you see my attached chart the plotting of this shows that all 3 moving averages in the plot, beginning on 4/8/2011, start to move away from the prices in my chart. I set FastPeriod to 3 so the blue line in the chart should hug the prices very closely.

      Even more odd each time when I call EMA(avgBarSeries,FastPeriod) in OnBarUpdate the value is the correct value, but the plot of the indicator on my chart doesn't match.

      What's going on here?

      Regards,

      TFH
      Attached Files

      Comment


        #4
        Hello TFH,

        I am trying to use the EMA indicator within my strategy to plot the average bar price, rather than the close.
        You can simplify a good bit, by just using:
        double avgBarPrice = EMA(Weighted, 14)[0];
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Charting works, but don't understand what I did failed

          Ryan,

          So I replaced my self.avgBarSeries = new DataSeries with the Weighted DataSeries and indeed my charting problem has been resolved. However, I don't understand why what I tried failed. In fact I'm employing the same technique to compute an exponential average true range. I don't use the canned ATR function because the decay rate for a given look-back period N is computed differently than passing a DataSeries of trueRange to EMA.

          My EMA(avgBarSeries) returned the correct value, but the plotting did not work (especially when I went further back prior to the last contract roll).

          What was wrong with my code snippet from my 4-22-11 posting? I'm doing the same thing computing an exponential true range.

          public class MyStrategy : Strategy
          {
          protected override void Initialize()
          {
          CalculateOnBarClose = true;

          this.trueRngSeries = new DataSeries(this);

          IndicatorBase slowETR = EMA(this.trueRngSeries,SlowPeriod);
          slowETR.Panel = 1
          slowETR.Plots[0].Pen.Color = Color.DeepSkyBlue;
          Add(slowETR);

          ...

          protected override void OnBarUpdate()
          {
          double trueRng;

          if (this.CurrentBar == 0)
          trueRng = High[0] - Low[0]
          else
          trueRng = Math.Max(High[0] - Low[0],Math.Max(Close[1] - Low[0],High[0] - Close[1])));
          this.trueRngSeries.Set(trueRng);

          Is the plotting wrong here as well? It's harder for me to tell optically than the EMA(Weighted,SlowPeriod) vs EMA(avgBarSeries,SlowPeriod) because in this case the bar prices and moving averages diverged substantially from each other.

          Please explain.

          Regards,

          TFH

          Comment


            #6
            HI TFH,

            I'm not sure what's wrong exactly. You're using type indicatorbase, which is not supported. For creating custom data series you don't need this type at all, and general data series help is available here:
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by George21, Today, 10:07 AM
            0 responses
            2 views
            0 likes
            Last Post George21  
            Started by Stanfillirenfro, Today, 07:23 AM
            8 responses
            23 views
            0 likes
            Last Post Stanfillirenfro  
            Started by DayTradingDEMON, Today, 09:28 AM
            2 responses
            16 views
            0 likes
            Last Post DayTradingDEMON  
            Started by navyguy06, Today, 09:28 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            8 responses
            32 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X