Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Non-time window

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

    Non-time window

    I wonder if anyone can tell/show me how to open a non-time window (a window in which time is not the x-axis) and plot a non-time histogram in it? I feel comfortable filling an array with the data (imagine a statistical distribution - "bins" on the x-axis and number of items in each bin on the y-axis). But I could use some help getting the array displayed.

    For example, is the code available that opens the Data Box?

    In addition, I will need to know how to write a start-up method - like adding it to the right-click menu (like the data box) or having a button, or a menu bar of my own.

    If you can point me to code examples that would be most helpful.

    Thanks !

    #2
    Hello,

    Unfortunately we do not have any supported methods for accomplishing these tasks, however it would be possible using unsupported methods.

    I'm including a link to a thread on some unsupported tips and tricks that may help you:



    We will leave this thread open in case any community members have some suggestions to help you with your projects.
    Last edited by NinjaTrader_Matthew; 08-02-2012, 09:43 PM.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by Mark_B View Post
      I wonder if anyone can tell/show me how to open a non-time window (a window in which time is not the x-axis) and plot a non-time histogram in it? I feel comfortable filling an array with the data (imagine a statistical distribution - "bins" on the x-axis and number of items in each bin on the y-axis). But I could use some help getting the array displayed.

      For example, is the code available that opens the Data Box?

      In addition, I will need to know how to write a start-up method - like adding it to the right-click menu (like the data box) or having a button, or a menu bar of my own.

      If you can point me to code examples that would be most helpful.

      Thanks !
      Not sure why the axis is of any relevance. C# gives you the ability to draw directly anywhere within the client rectangle of the form, (most easily by using offsets from the top corner), so just draw.

      Comment


        #4
        Non-time windows

        Thanks for the reply Koganam.

        I may be looking at the issue with a closed mind - yours may be more open. I am not a particularily good programmer, either, and I struggle in the Ninja/C# environment.

        What I am trying to do is build a statistical distribution of past bar events. Let's use Range (high-low) as an example. I'd like to look back maybe 2,000 bars and see the distribution of bar ranges.

        Filling the array (or collection) might look something like this

        For x= 1 to lookback
        Range(x) = High(x) - Low(x)
        Array(range(x)) = Array(range(x)) + 1
        end

        It might actually be possible to combine the "Range" and the "Array" lines together into one, but I left them separate for the sake of clarity. The actual most efficient programming method is better left to a programmer, after all.

        I would then like to plot that array (collection) with the values of Range(x) as the x-axis and the Array values as the y-axis. There would be a minimum Range value (not necessarily 0 or 1) and a maximum Range value that cannot be known ahead of time (which is why I suggest that a collection might be a better structure for holding the data). We could collect some of this info as we fill the array (collection) to allow us to size the plot, if necessary (if it won't auto-size). That code was omitted for clarity as well.

        Note that this has nothing to do with time. A normal chart (almost) always has time as the x-axis. Indicators, paintbars, etc are associated with the bar at a given time. That is not the case here.

        There is too much information to display as an indicator. If we wanted only the mean and/or std dev we could add them as indicators in an MACD-type format.

        I realize that the distribution won't change much from bar to bar, so there is no real need to display it constantly updating with every bar (as is done with Market Profile). I'd just like to run it every so often so that I can see what is going on. I also intend to look at more than just the range. This becomes a template allowing us to look at all sorts of distributions.

        Any chance you would want to take a stab at making it happen? Anybody?

        Comment


          #5
          Hello Mark_B,
          To open a new Form you can refer to this code.


          Unfortunately nothing that we could officially support.
          JoydeepNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Radano, 06-10-2021, 01:40 AM
          19 responses
          606 views
          0 likes
          Last Post Radano
          by Radano
           
          Started by KenneGaray, Today, 03:48 AM
          0 responses
          4 views
          0 likes
          Last Post KenneGaray  
          Started by thanajo, 05-04-2021, 02:11 AM
          4 responses
          470 views
          0 likes
          Last Post tradingnasdaqprueba  
          Started by aa731, Today, 02:54 AM
          0 responses
          5 views
          0 likes
          Last Post aa731
          by aa731
           
          Started by Christopher_R, Today, 12:29 AM
          0 responses
          11 views
          0 likes
          Last Post Christopher_R  
          Working...
          X