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

Converting Chart Style Type

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

    Converting Chart Style Type

    Dear support,

    What is the NT8 version for this NT7 line script:

    Code:
     if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)
                  {
                     Do Something
                  }
    References in Help did not help.

    Many thanks

    #2
    Hello aligator,

    From my understanding this was not documented or officially supported for NinjaTrader 7.

    I may incorrect. Do you have a link to the NinjaTrader 7 help guide on ChartControl.ChartStyleType?

    (Only documented items for NT7 will be listed in the code breaking changes for NT8)

    In NinjaTrader 8 this would be documented and supported. This is found in ChartBars.Properties. Below is a public link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello aligator,

      From my understanding this was not documented or officially supported for NinjaTrader 7.

      I may incorrect. Do you have a link to the NinjaTrader 7 help guide on ChartControl.ChartStyleType?

      (Only documented items for NT7 will be listed in the code breaking changes for NT8)

      In NinjaTrader 8 this would be documented and supported. This is found in ChartBars.Properties. Below is a public link to the help guide.
      https://ninjatrader.com/support/help...properties.htm
      Thanks Chelsea,

      Unfortunately, the link is not much help to me without any examples, although the ChartStyleType is supported. The above script works in NT7 but not in NT8. I do not have access to NT7 Help.

      All I am looking for is a translation of the above or an equal IF statement for NT8. What is an equal IF statement in NT8 that I can use?

      Thanks.
      Last edited by aligator; 01-07-2019, 12:18 AM.

      Comment


        #4
        Ninja answer here https://ninjatrader.com/support/foru...letype?t=90141

        Hello jbenton,

        Thanks for your post and welcome to the forums!

        Member gubbar924 was close (thank-you), you would want to test using:

        if (ChartBars.Properties.ChartStyleType == ChartStyleType.Box)
        {
        // do something
        }

        Reference: http://ninjatrader.com/support/helpG...us/?charts.htm

        Comment


          #5
          Hello aligator,

          If you have access to the internet you should have access to the NinjaTrader 7 help guide which is available on the internet on our website..



          In fact, it is important that you have access to both the NinjaTrader 7 and NinjaTrader 8 help guides.

          If you are unable to access the NinjaTrader 7 help guide from the link above, please let me know so that we can diagnose.


          May I confirm you are able to access the NinjaTrader 8 help guide linked below as well?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hello aligator,

            I am not able to reproduce.

            Attached is a test script.

            Are you able to import the script, open a NinjaScript Output window, and then add the indicator to a chart?
            Does anything appear in the output window?


            I was not able to confirm a previous inquiry. You mentioned you are not able to access the NinjaTrader 7 help guide. Is this still the case?
            Attached Files
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello aligator,

              I am not able to reproduce.

              Attached is a test script.

              Are you able to import the script, open a NinjaScript Output window, and then add the indicator to a chart?
              Does anything appear in the output window?


              I was not able to confirm a previous inquiry. You mentioned you are not able to access the NinjaTrader 7 help guide. Is this still the case?
              Thanks ChelseaB,

              This one works fine, Thanks.

              It is funny, I was using exactly the same script after nkhoi posted the example above and it would not compile. Then I deleted the _Workspace file and reopened a new instance of the Ninja Editor and the script compiled perfect.

              I guess somehow a corrupt Editor page with a previously failed script was being saved as part of the _Workspace file.

              Thanks to you and nkhoi for the script.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rajendrasubedi2023, Today, 09:50 AM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by lorem, Today, 09:18 AM
              2 responses
              11 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by geddyisodin, Today, 05:20 AM
              4 responses
              29 views
              0 likes
              Last Post geddyisodin  
              Started by geotrades1, Today, 10:02 AM
              2 responses
              9 views
              0 likes
              Last Post geotrades1  
              Started by ender_wiggum, Today, 09:50 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X