• 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

Indicator and BarType

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

    Indicator and BarType

    Is there a way for an indicator to talk to (programatically manipulate) the behavior of a BarType?
    Are there any guidelines for how this interaction should look?

    Thanks,
    Gary

    #2
    Hello GaryAlbers,

    Thank you for your post.

    What behavior do you need from the indicator that the Bar Type class cannot provide?
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Depending on how stretched out the user has the chart, I show different stuff on the chart and sometimes that means I want to draw my own information instead of the bar. To do this in NT 7, I was making the bar colors transparent and then drawing on the chart.
      With NT 8 I am trying to determine if there is a more elegant way to have the indicator communicate with the BarType so the logic for hiding the bar can be kept in the BarType rather than the indicator.


      Also, there is logic that has traditionally been done in OnMarketData which I think would be better if it were in the BarType. However, that would require the indicator/strategy to query the bartype to get this information so it can make signal decisions based on it.
      Another way of asking, is this: can OnMarketData be implemented in BarType and then methods added to return data structures?

      Thanks,
      Gary

      Comment


        #4
        Hello GaryAlbers,

        Thank you for your patience.

        You can access the OnMarketData() in the Bar Types. I am still unclear what would need to be ran in the Indicator that could not be done in the Bar Types. You should be able to use OnRender to draw.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello GaryAlbers,

          Thank you for your patience.

          You can access the OnMarketData() in the Bar Types. I am still unclear what would need to be ran in the Indicator that could not be done in the Bar Types. You should be able to use OnRender to draw.
          Custom chart program will not compile after adding the following method code.

          //------------------------------------------------------------------------------------------------------------------------

          protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
          {

          }

          //-----------------------------------------------------------------------------------------------------------------------

          Error Message: "No suitable method found to override."



          Using the following:


          //#region Using declarations
          using System;
          using System.ComponentModel;
          using NinjaTrader;
          using NinjaTrader.Cbi;
          using NinjaTrader.Core.FloatingPoint;
          using NinjaTrader.Data;
          using NinjaTrader.NinjaScript;


          using System.Collections.Generic;
          using System.ComponentModel.DataAnnotations;
          using System.Linq;
          using System.Text;
          using System.Threading.Tasks;
          using System.Windows;
          using System.Windows.Input;
          using System.Windows.Media;
          using System.Windows.Forms;
          using System.Xml.Serialization;
          using NinjaTrader.Gui;
          using NinjaTrader.Gui.Chart;
          using NinjaTrader.Gui.SuperDom;
          using NinjaTrader.NinjaScript.DrawingTools;
          using SharpDX;
          using SharpDX.Direct2D1;
          using SharpDX.DirectWrite;
          //#endregion
          RJay
          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

          Comment


            #6
            Please clarify

            Sorry Patrick, your wording is unclear.

            The method: protected override void OnMarketData(MarketDataEventArgs e)
            is not recognized in a BarType so what did you mean 'You can access the OnMarketData() in the Bar Types'?

            In a different post, I made a request for documentation on how to understand and code BarType. If that were available now, it would sure clear up lots of questions and potentially lead to much cooler stuff built the 'right' way for Ninja.


            Gary

            Comment


              #7
              Hello Gary & RJay,

              Thank you for your responses.

              OnRender would be accessible through ChartStyles rather than BarTypes like I originally stated.

              For the Market Data, you are correct and we would need communicate between the BarTypes and Indicator - so we could draw as BarTypes does not user OnRender.
              Thank you for your patience, and I will respond with an example and more information.
              Patrick H.NinjaTrader Customer Service

              Comment


                #8
                Hello Gary,

                Thank you for your patience.

                This would need to be done through the indicator as you would have done in NinjaTrader 7.
                Patrick H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by digibob, Today, 10:01 PM
                0 responses
                1 view
                0 likes
                Last Post digibob
                by digibob
                 
                Started by ptertich, Today, 09:59 PM
                0 responses
                1 view
                0 likes
                Last Post ptertich  
                Started by sledge, Today, 06:11 PM
                1 response
                8 views
                0 likes
                Last Post sledge
                by sledge
                 
                Started by Bionian, Today, 02:46 PM
                2 responses
                9 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by rwilliam, Today, 01:54 PM
                1 response
                19 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X