• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

All GomRecorder Indicators

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

    #61
    Gomi,

    Should GomCDSMA be a regular indicator and not a GomRecoderIndicator?


    I have tried to modify the GomCDSMA indicator to be plotted in different colors if it's rising or falling. I used the code from an EMA with up/down colors that I have created. I basically substituted EMA for GomCDSMA and also turned it into a GomRecorderIndicator, GomInitialize() etc. (Do I need to do that?) It works great with historic data but with live data it sometimes gets the colors mixed up, however, the values are always correct (the same as GomCDSMA). When i reload ninja script it shows the right colors again. I can't figure out why the colors get mixed up. Would be great if someone could figure out what the problem is with it. I'll attach a chart with the indicator where you can see the color is green the last few bars where it should be red.

    The script looks like this.



    //
    // Copyright (C) 2007, NinjaTrader LLC <www.ninjatrader.com>.
    // NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
    //
    #region Using declarations
    using System;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.ComponentModel;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Gui.Chart;
    #endregion

    // This namespace holds all indicators and is required. Do not change it.
    namespace NinjaTrader.Indicator
    {
    /// <summary>
    /// This is an indicator plotting an ema in two colors.
    /// </summary>
    [Description("Cumulative Volume Delta plotted with two colors.")]
    [Gui.Design.DisplayName("CDSMA_Up_Down")]
    public class CDSMA_Up_Down : GomRecorderIndicator
    {
    #region Variables
    private int period = 9;
    #endregion

    /// <summary>
    /// This method is used to configure the indicator and is called once before any bar data is loaded.
    /// </summary>
    protected override void GomInitialize()
    {
    // Add one plot for every color you wish to use.
    Add(new Plot(Color.Lime, PlotStyle.Line, "Rising"));
    Add(new Plot(Color.Red, PlotStyle.Line, "Falling"));


    CalculateOnBarClose = false;
    Overlay = false;
    PriceTypeSupported = false;

    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void GomOnBarUpdate()
    {
    // Checks to make sure we have at least 1 bar before continuing
    if (CurrentBar<1)
    return;

    // Plot green if the CVD is rising
    // Rising() returns true when the current value is greater than the value of the previous bar.
    if (Rising(GomCDSMA(Period)))
    {
    // Connects the rising plot segment with the other plots
    RisingPlot.Set(1, GomCDSMA(Period)[1]);

    // Adds the new rising plot line segment to the line
    RisingPlot.Set(GomCDSMA(Period)[0]);
    }

    // Plot red if the CVD is falling
    // Falling() returns true when the current value is less than the value of the previous bar.
    else if (Falling(GomCDSMA(Period)))
    {
    // Connects the new falling plot segment with the rest of the line
    FallingPlot.Set(1, GomCDSMA(Period)[1]);

    // Adds the new falling plot line segment to the line
    FallingPlot.Set(GomCDSMA(Period)[0]);
    }


    }
    Attached Files
    Last edited by mpe66; 01-22-2010, 09:12 AM.

    Comment


      #62
      I think this is a bug with NT and the .Set(1, var[1]) line that is supposed to connect the current value with the prior value using the properly colored line segment. If you insert a BackColor = Color.(Up and Down Color) in the Rising/Falling brackets, you will see the background color change correctly, but the line segment does not. I have tried to conditionally offset 2, [2] on FirstTickOfBar, but it only colors the line segment correctly 95% of the time.
      Attached Files

      Comment


        #63
        Hello,

        This link may be useful:
        http://www.ninjatrader-support2.com/...ead.php?t=3227

        You need to redraw just prior.
        DenNinjaTrader Customer Service

        Comment


          #64
          Originally posted by NinjaTrader_Ben View Post
          Hello,

          This link may be useful:
          http://www.ninjatrader-support2.com/...ead.php?t=3227

          You need to redraw just prior.
          Hello

          Yes, thank you - but it IS redrawing just prior. The sample Rising/Falling is being used with only a dataseries substitution, but it is producing incorrect results.
          The logic of identifying whether the series is rising or falling is correct though, as the background color changes show. The code RisingPlot.Set(1, Series[1]); and FallingPlot.Set(1, Series[1]); are not drawing properly.
          Last edited by Tarkus11; 01-23-2010, 11:11 AM.

          Comment


            #65
            Tarkus11, I believe you run into a known issue on 6.5 - could you please post your code used or PM it to me so I can check into? Thanks
            BertrandNinjaTrader Customer Service

            Comment


              #66
              Originally posted by NinjaTrader_Bertrand View Post
              Tarkus11, I believe you run into a known issue on 6.5 - could you please post your code used or PM it to me so I can check into? Thanks
              Thank you - I was doing basically the same as the code posted by mpe66 (where he brings up the coloring problem) 5 posts prior to this one. All I did was add a BackColor line into the Rising/Falling brackets to make sure the rising/falling method was correctly identifying the condition but the plot was not.
              Last edited by Tarkus11; 01-25-2010, 07:22 AM.

              Comment


                #67
                Tarkus11, thanks check into and this would be resolved with NT7's new MultiColor Plot approach where you would need to use only one Plot to change colors - http://www.ninjatrader-support2.com/...89&postcount=1
                BertrandNinjaTrader Customer Service

                Comment


                  #68
                  Originally posted by NinjaTrader_Bertrand View Post
                  Tarkus11, thanks check into and this would be resolved with NT7's new MultiColor Plot approach where you would need to use only one Plot to change colors - http://www.ninjatrader-support2.com/...89&postcount=1
                  Thanks again. It is only a minor cosmetic issue in 6.5 IMO. Is there an ETA for ver 7 release?

                  Comment


                    #69
                    You can see all development status updates and a highlevel feature overview here - http://www.ninjatrader.com/webnew/NT7/NinjaTrader7.html

                    We currently target a public beta within the next month, a production release would follow then a few months after this.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #70
                      NT7 B7 issue flatlines CD

                      Hi Gomi,
                      Looks like beta 7 has skewed CD to display only flat lines. Not sure what in beta 7 is causing this, but I tried several instruments on different chart settings to same effect.



                      Pressing F5 has had no effect to correct this anomaly.

                      Edit: Several minutes past, I opened a new chart and the stored CD data is correctly displayed but not the real-time data. The issue seems to be in displaying real-time CD bars as they are being built. Pressing F5 corrects the past bars but can't keep using F5 for every single bar!

                      Edit: I can't believe I am the only one experiencing this behavior. NT Support could you please help.

                      Cheers,
                      SA
                      Last edited by superarrow; 01-29-2010, 04:09 AM. Reason: upload image

                      Comment


                        #71
                        Hi,

                        Pretty sure this has to do with the FirsttickOfBar bug... So guess you'll have to wait for B8 !

                        Comment


                          #72
                          Thank you Gomi and NT Team.

                          Originally posted by gomifromparis View Post
                          Hi,

                          Pretty sure this has to do with the FirsttickOfBar bug... So guess you'll have to wait for B8 !
                          You are so right. Beta 8 has fixed the problem and I am not only happy but also very impressed at NT Team for releasing beta 8 so quickly considering that beta 7 was released only just last week!

                          Thank you Gomi and NT Team.

                          Cheers,
                          SA

                          Comment


                            #73
                            GomCDHA plot bug?

                            I'm getting an error in GomCDHA in Ninja 6.5 when on the first tick of a new bar the plot moves from it's last value to zero. This creates a problem especially in small range bars (eg 2 tick) by squashing the plot in the panel.

                            I can find a reference to FirstTickOfBar bug in NT 7 but nothing for NT 6.5 and nothing relating to GomCDHA.

                            Any ideas? A 5 second bar shows the problem easily

                            Great indicators by the way.....brilliant work. Thank you.

                            Comment


                              #74
                              GomCDSMA Beta 8 Problem

                              Just updated to Beta 8 and GomCDSMA no longer seems to be working properly. The indicator plots incorrectly in real-time. Pressing the F5 key (Reload NinjaScript) corrects the plot, but then it continues to plot incorrectly from that point forward. Any ideas?

                              Comment


                                #75
                                Originally posted by gomifromparis View Post
                                no you don't need Qcollector, IRT export is enough
                                Is Investor R/T Standard Edition $40/month enough or do I need to get the Professional Edition which includes volume breakdown etc?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by TazoTodua, Today, 04:26 PM
                                0 responses
                                1 view
                                0 likes
                                Last Post TazoTodua  
                                Started by ScorpioTravis, Today, 04:26 PM
                                0 responses
                                1 view
                                0 likes
                                Last Post ScorpioTravis  
                                Started by ralett, Today, 03:09 PM
                                1 response
                                3 views
                                0 likes
                                Last Post NinjaTrader_ChristopherJ  
                                Started by martyn73, Today, 02:54 PM
                                2 responses
                                13 views
                                0 likes
                                Last Post martyn73  
                                Started by Zigfried, Today, 01:59 PM
                                4 responses
                                14 views
                                0 likes
                                Last Post Zigfried  
                                Working...
                                X