• 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

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, 11:18 AM.

      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 moyerchopra, Yesterday, 11:43 PM
        0 responses
        1 view
        0 likes
        Last Post moyerchopra  
        Started by ttodua, Yesterday, 11:40 PM
        0 responses
        1 view
        0 likes
        Last Post ttodua
        by ttodua
         
        Started by edmata1109, 12-04-2019, 09:19 PM
        8 responses
        28 views
        0 likes
        Last Post koganam
        by koganam
         
        Started by maindoor, 12-03-2019, 10:45 PM
        9 responses
        63 views
        0 likes
        Last Post koganam
        by koganam
         
        Started by w0lverine, Yesterday, 08:22 PM
        0 responses
        1 view
        0 likes
        Last Post w0lverine  
        Working...
        X