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?

    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.

        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.

              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.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, 04-17-2024, 06:40 PM
                6 responses
                48 views
                0 likes
                Last Post algospoke  
                Started by arvidvanstaey, Today, 02:19 PM
                4 responses
                11 views
                0 likes
                Last Post arvidvanstaey  
                Started by samish18, 04-17-2024, 08:57 AM
                16 responses
                61 views
                0 likes
                Last Post samish18  
                Started by jordanq2, Today, 03:10 PM
                2 responses
                9 views
                0 likes
                Last Post jordanq2  
                Started by traderqz, Today, 12:06 AM
                10 responses
                18 views
                0 likes
                Last Post traderqz  
                Working...
                X