Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why Multi-timeframe Plots are useless on Ninjatrader...

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

    Why Multi-timeframe Plots are useless on Ninjatrader...

    You need to draw a trendline of the plot, or you miss the bus.

    I've literally spent hours trying to solve this. Why can't secondary data series plot OnEachTick?

    I'm really annoyed I missed that move.
    Attached Files

    #2
    Hello reach4thelasers,

    Thanks for opening the thread.

    I am able to have an indicator that operates on a separate data series update its plots with each incoming tick when I use Calculate.OnEachTick. I am adding a plot to the calling NinjaScript that has Calculate.OnEachTick set, and I am updating the Value it uses within OnBarUpdate() for the BarsInProgress of that data series. Each additional data series is being calculated for each tick.

    Here is some sample code describing what I am doing.

    Code:
    else if (State == State.Configure)
    	{				
    		AddDataSeries(Instrument.FullName, BarsPeriod);
    		AddPlot(Brushes.Red, "MyPlot");
    	}
    	else if (State == State.DataLoaded)
    	{
    		myIndicator = Indicator(BarsArray[1]);
    	}				
    }
    
    protected override void OnBarUpdate()
    {
    	if(CurrentBars[0] < 1 || CurrentBars[1] < 1) return;
    	
    	if (BarsInProgress == 1)
    	{
    		Values[0][0] = myIndicator.Value[0];
    	}	
    }
    Single Tick data series' can be used for intra bar granularity for historical data, and can be used to update the plots per tick as well.

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hey Jim,

      I replicated your code exactly and tried to use it with the EMA indicator. What am I doing wrong here? It doesn't seem to do anything...

      Cheers,,

      Kev


      Originally posted by NinjaTrader_Jim View Post
      Hello reach4thelasers,

      Thanks for opening the thread.

      I am able to have an indicator that operates on a separate data series update its plots with each incoming tick when I use Calculate.OnEachTick. I am adding a plot to the calling NinjaScript that has Calculate.OnEachTick set, and I am updating the Value it uses within OnBarUpdate() for the BarsInProgress of that data series. Each additional data series is being calculated for each tick.

      Here is some sample code describing what I am doing.

      Code:
      else if (State == State.Configure)
      	{				
      		AddDataSeries(Instrument.FullName, BarsPeriod);
      		AddPlot(Brushes.Red, "MyPlot");
      	}
      	else if (State == State.DataLoaded)
      	{
      		myIndicator = Indicator(BarsArray[1]);
      	}				
      }
      
      protected override void OnBarUpdate()
      {
      	if(CurrentBars[0] < 1 || CurrentBars[1] < 1) return;
      	
      	if (BarsInProgress == 1)
      	{
      		Values[0][0] = myIndicator.Value[0];
      	}	
      }
      Single Tick data series' can be used for intra bar granularity for historical data, and can be used to update the plots per tick as well.

      Please let me know if I may be of further assistance.
      Attached Files
      Last edited by reach4thelasers; 05-19-2017, 12:18 PM.

      Comment


        #4
        Hello Kevin,

        Thanks for writing back.

        Perhaps I misunderstood your question. When I test your sample indicator, I am seeing the EMA's plot updating with each tick, before the close of the current bar.

        I've attached a couple screenshots depicting the plot updating after each tick when connected to the simulated data feed.

        If I am missing the boat here, could you provide me a bit more detail as to what you are trying to accomplish?

        I look forward to being of further help.
        Attached Files
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by yertle, Yesterday, 08:38 AM
        7 responses
        28 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        21 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by funk10101, Today, 12:02 AM
        0 responses
        4 views
        0 likes
        Last Post funk10101  
        Started by gravdigaz6, Yesterday, 11:40 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by MarianApalaghiei, Yesterday, 10:49 PM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X