Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tick replay on an indicator

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

  • NinjaTrader_Jesse
    replied
    Hello speedytrade02,

    In addition to enabling the option in the options menu you also need to check the tick replay box in the data series window for the chart, did you do that?

    Leave a comment:


  • speedytrade02
    replied
    Thanks for you response. I've already activate the (Center > Tools > Options > Market Data > check the box for "Show Tick Replay") option, but I'm not getting previous values from the chart. Maybe is because I'm using BuySellVolume indicator in order to create my indicator? also which connection should I use to test my indicator?

    HTML Code:
    protected override void OnBarUpdate()
            {
                if (Bars == null || CurrentBar == 0)
                    return;
    
                if (Bars.IsLastBarOfSession)
                {
                    cumulativeDelta = 0.0;
                    previousDelta = 0.0;
                }
    
                double currentDelta = BuySellVolume().Buys[0] - BuySellVolume().Sells[0];
                double deltaDifference = currentDelta - previousDelta;
                cumulativeDelta += deltaDifference;
                previousDelta = currentDelta;
    
                Value[0] = cumulativeDelta;
            }​

    Last edited by speedytrade02; 09-02-2023, 08:10 AM.

    Leave a comment:


  • NinjaTrader_Emily
    replied
    Hello speedytrade02,

    Thank you for your post.

    I suggest reviewing the help guide section about developing for tick replay here:To enable tick replay on a chart, you must first go to Control Center > Tools > Options > Market Data > check the box for "Show Tick Replay" > click OK to save the change. Then, once it has been enabled in the options, you will have an option in the Data Series window to use tick replay on a chart. For more information:Please let us know if we may be of further assistance.

    Leave a comment:


  • speedytrade02
    started a topic Tick replay on an indicator

    Tick replay on an indicator

    Hi, I've created an indicator, but it's only working in real time. How can I use tick replay in order to see what the indicator values have been in the past?

    Here's my code:

    HTML Code:
    protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Enter the description for your new custom Indicator here.";
                    Name                                        = "CummulativeDelta";
                    Calculate                                    = Calculate.OnEachTick;
                    BarsRequiredToPlot                            = 1;
                    IsOverlay                                    = false;
                    DisplayInDataBox                            = true;
                    DrawOnPricePanel                            = true;
                    DrawHorizontalGridLines                        = true;
                    DrawVerticalGridLines                        = true;
                    PaintPriceMarkers                            = true;
                    ScaleJustification                            = NinjaTrader.Gui.Chart.ScaleJustification.Right;
                    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
                    //See Help Guide for additional information.
                    IsSuspendedWhileInactive                    = true;
                    //AddPlot(Brushes.Blue, "CumulativeDelta");
                    AddPlot(Brushes.RoyalBlue, "CumulativeDelta");
                    AddLine(new Stroke(Brushes.Gray, DashStyleHelper.Dot ,1), 0, "ZeroLine");
                }
                else if (State == State.Configure)
                {
                }
            }
    
            protected override void OnBarUpdate()
            {
                if (Bars == null || CurrentBar == 0)
                    return;
    
                if (Bars.IsLastBarOfSession)
                {
                    cumulativeDelta = 0.0;
                    previousDelta = 0.0;
                }
    
                // indicator logic
    
                Value[0] = indicator result;
            }
        }​

Latest Posts

Collapse

Topics Statistics Last Post
Started by Chuso, 01-14-2025, 03:41 AM
5 responses
24 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by reynoldsn, Yesterday, 02:47 PM
1 response
12 views
0 likes
Last Post NinjaTrader_LuisH  
Started by alphatango, 01-13-2025, 11:58 AM
2 responses
12 views
0 likes
Last Post alphatango  
Started by terryreeves_, Yesterday, 04:13 PM
1 response
7 views
0 likes
Last Post NinjaTrader_Gaby  
Started by sweeper2024, 01-13-2025, 06:09 AM
4 responses
27 views
0 likes
Last Post sweeper2024  
Working...
X