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 Harry, 05-02-2018, 01:54 PM
        10 responses
        3,202 views
        0 likes
        Last Post tharton3  
        Started by cre8able, Yesterday, 01:16 PM
        3 responses
        11 views
        0 likes
        Last Post cre8able  
        Started by ChartTourist, Today, 08:22 AM
        0 responses
        6 views
        0 likes
        Last Post ChartTourist  
        Started by LiamTwine, Today, 08:10 AM
        0 responses
        2 views
        0 likes
        Last Post LiamTwine  
        Started by Balage0922, Today, 07:38 AM
        0 responses
        5 views
        0 likes
        Last Post Balage0922  
        Working...
        X