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

EasyLanguage to NinjaScript

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

    EasyLanguage to NinjaScript

    I am converting a large app from EL to c# for NT. So far so good, but I have questions I would like help with:

    Where can I find environment variables for the whole NT system and the chart the indicator is applied to. I would like things like chart resolution so I can work out spacing for my lines, and license key details for security purposes.

    I use the Forms class to create new windows output screens. How do I get rid of old windows when the software restarts or when the NT app closes. I keep building up a number of windows, one each time I run the indicator. I think dispose or destroy might do it but I don't know how to call on NT close.

    #2
    Hello RobinT,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    Are you building in NinjaTrader 7 or 8? In NinjaTrader 7 most of the items you are asking about are unsupported. In NinjaTrader 8, these items would be supported though.

    For NinjaTrader 7 you would use GetMinMaxValues for the chart scale. For example:
    Code:
    		public override void GetMinMaxValues(Gui.Chart.ChartControl chartControl, ref double min, ref double max)
    		{
    			base.GetMinMaxValues(chartControl, ref min, ref max); 
    			min = -20; 
    			max = 120; 
    		}
    You can find an example on creating and disposing a custom form at the following link: http://www.ninjatrader.com/support/f...d=4&linkid=475

    Keep in mind these items are unsupported in NinjaTrader 7.

    In NinjaTrader 8 you would use the AddOns class for the window: http://ninjatrader.com/support/helpG...-us/add_on.htm
    For the chart scale you would use chart scale, literally: http://ninjatrader.com/support/helpG...chartscale.htm

    Comment


      #3
      I am using NT7 as I thought writing for NT8 might be premature. Is that right? Should I use NT8 now

      Comment


        #4
        ps,thanks for the reply.

        Comment


          #5
          RobinT,

          It is up to you. NinjaTrader 8 is still in beta. I just wanted to provide you with both options.

          Comment


            #6
            Array

            I use a multi dimensional array, 50 rows each 6 columns. I only need to sort descending on the first column so I have a sorted array on the first column with all the other data still related to column1. Does anyone know how to sort a decimal array like this or should I use another ninjascript data structure.

            .private decimal [,] Htargets = new decimal [depth , arrsize ] ;

            arrsize = 50 ;
            depth = 6 ;

            I only want to sort descending on depth = 1 ;

            Comment


              #7
              Hello RobinT,

              I would take a look at the information at the following link at StackOverflow: http://stackoverflow.com/questions/2...nal-array-in-c
              Last edited by NinjaTrader_PatrickH; 02-16-2016, 08:32 AM.

              Comment


                #8
                Thanks, I wrote my own quicksort algo in the end.

                Comment


                  #9
                  If someone could point me to posts about line drawing, I would be grateful.

                  Comment


                    #10
                    RobinT,

                    I think what you are looking for would be under Tools > Edit NinjaScript > CustomPlotSample.

                    Comment


                      #11
                      I am looking for a Horizontal line from a start point and extends right as time progresses. I can use:

                      Drawline (

                      and set the endtime to DateTime.Now on every bar

                      is there a way of using DrawExtendedLine ( and have it not extend left as I dont want that.

                      Comment


                        #12
                        would I be correct in thinking a Ray does what I want and when I am finished with the line I can convert it into a Drawline (). It says a ray extend in one direction, but it doesn't say which direction.

                        Comment


                          #13
                          I have a number of Rays, each with its own unique tag, "TL01", "TL99" etc. Once these are plotted how do I get and change the parameters using the tag. I want to get the Startdate and I want to change the color.

                          Comment


                            #14
                            also if I have multiple charts, how do I get data from multiple data streams.

                            Comment


                              #15
                              Where can I find a list of programmable properties like:

                              HorizontalGridLines = false;

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by RookieTrader, Today, 09:37 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post RookieTrader  
                              Started by KennyK, 05-29-2017, 02:02 AM
                              3 responses
                              1,282 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              11 responses
                              184 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by fernandobr, Today, 09:11 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by timmbbo, Today, 08:59 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Working...
                              X