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

Coding Help Needed

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

    #46
    Excellent, I'll give it a considerable amount of time to see if I could figure it out.
    Would you please specify the equivalences of the following members in NT8?

    1. ChartControl.ChartPanel.Invalidate();
    2. ChartControl.AxisColor

    You've been so helpful Jesse!!
    THANK YOU!!
    Last edited by Mukaddim; 09-18-2018, 08:28 PM.

    Comment


      #47
      Hello Mukaddim,

      The invalidate method is no longer present in the same way and also should not be used in NT8. There is a small note about this in the help guide referring to using invalidate which can cause deadlocks. You have a couple of alternatives.

      The first suggestion is to queue a refresh by using ForceRefresh:


      The second would be to add a dummy drawing object, and then immediately remove it. Removing a drawing object specifically causes a re-render. Using autoscale false and a 0 value should hide the object to make it a utility instead of a visual.

      The equivalent of the AxisColor should be the AxisPen which can be found in the ChartControls properties. This is now documented which you can find here:


      I look forward to being of further assistance.
      Last edited by NinjaTrader_Jesse; 09-19-2018, 09:43 AM.
      JesseNinjaTrader Customer Service

      Comment


        #48
        HiJesse! Thanks for the reply. I couldn't find AxisPen in ChartControl in the link you provided. ForceRefresh is working ☺️.
        Mukaddim

        Comment


          #49
          Hello Mukaddim,

          Sorry about that, it looks like I grabbed the ChartControl main page but you need the Properties subpage from the ChartControl main page.

          I updated the prior post and here is the correct link as well: https://ninjatrader.com/support/help...properties.htm

          Code:
          ChartControl.Properties.AxisPen.Pen = new Pen(Brushes.Red, 5);
          I look forward to being of further assistance.
          Last edited by NinjaTrader_Jesse; 09-19-2018, 09:48 AM.
          JesseNinjaTrader Customer Service

          Comment


            #50
            No problem whatsoever!!!
            Thank you Jesse!
            Do you mind if I ask for an example of a Multi Time Frame Indicator? Couldn't find any in this forum.
            Mukaddim

            Comment


              #51
              Hello Mukaddim,

              The MultiSeries scripts are basically all the same, so the SampleMultiInstrument strategy and SampleMultiTimeframe strategies that come with NinjaTrader will contain the code needed.

              You can also find samples in the help guide of multi series here:


              The multi series documentation also contains all of the conditions that surround using multiple series so this is a good resource as well:



              Please let me know if I may be of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #52
                Thanks a bunch Jesse!!

                On a different note, after compilation and exporting successfully, one of my indicators does not work once the assembly is imported.

                Any suggestions?
                Thanking
                Mukaddim

                Comment


                  #53
                  Hello Mukaddim,

                  Thank you for the reply.

                  Are you seeing any errors in the log of the control center or the NinjaScript output window? These would be good first steps to check. If there is nothing being listed, you may need to do a test export where you add some Prints to your script to see where the logic is failing in that use case.

                  After I know if you are getting errors or not, that would help direct further troubleshooting.

                  I look forward to being of further assistance.
                  JesseNinjaTrader Customer Service

                  Comment


                    #54
                    Hi Jesse!,
                    Nothing in the log, that's where I am stuck!!

                    Comment


                      #55
                      Hello Mukaddim,

                      Thank you for the reply.

                      Yes, in this case, you will need to add Prints to the script to see where the logic is failing.

                      I would suggest putting a print into OnStateChange and also in OnBarUpdate to make sure the script is processing.

                      Code:
                      protected override void OnStateChange()
                      {
                      	Print("Current State: " + State);
                      
                      protected override void OnBarUpdate()
                      {
                      	Print("OnBarUpdate Processing");
                      }
                      After adding these and running the script, do you see any output? This will let you know what state the script is stopping or if OnBarUpdate is being run. if you see that OnBarUpdate is running then likely the problem resides somewhere in your logic.


                      I look forward to being of further assistance.
                      JesseNinjaTrader Customer Service

                      Comment


                        #56
                        Thank you Jesse! Before I start, I need to ask if

                        I only need to check the indicator that's not working, right?
                        I will do this to imported assembly, is that right?

                        Mukaddim

                        Comment


                          #57
                          Hello Mukaddim,

                          Thank you for the reply.

                          Yes you will need to check whichever item is not working. If that is only the indicator, that would be what to check. If you are calling the indicator from another script, you would likely need to add prints into both scripts.

                          And you are correct, you want this to be in the compiled assembly so you can see the prints on the machine/test where it is not working.

                          I look forward to being of further assistance.
                          JesseNinjaTrader Customer Service

                          Comment


                            #58
                            Hello Jesse!
                            Thanks for your reply.
                            Here's a screenshot of the print out.
                            Mukaddim.
                            Attached Files
                            Last edited by Mukaddim; 09-20-2018, 09:07 AM.

                            Comment


                              #59
                              Hello Mukaddim,

                              Thank you for the reply.

                              This output would indicate the indicator is processing as you can see output going through the states and proceeding through OnBarUpdate.

                              Because the indicator is not stopping and is actually working, this will give you a good starting place to further diagnose what is happening.

                              As I am unsure what this item does, what specifically is not working when you apply it? Does this have a plot and that is not visible or what is the specific problem?

                              To further test the issue, now that you know OnBarUpdate is working you could add more prints to identify where the breakdown in OnBarUpdate is in regard to what is not working.

                              I look forward to being of further assistance.
                              JesseNinjaTrader Customer Service

                              Comment


                                #60
                                Hello Jesse,
                                Thank you for the reply.

                                The indicator shows horizontal line price, So when the indicator is applied, it gives you the price level on a HZ line that you draw. Let me know if you wanna have a look at it.

                                Thanking
                                Mukaddim

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Max238, Today, 01:28 AM
                                5 responses
                                42 views
                                0 likes
                                Last Post Max238
                                by Max238
                                 
                                Started by giulyko00, Yesterday, 12:03 PM
                                3 responses
                                12 views
                                0 likes
                                Last Post NinjaTrader_BrandonH  
                                Started by habeebft, Today, 07:27 AM
                                1 response
                                14 views
                                0 likes
                                Last Post NinjaTrader_ChristopherS  
                                Started by AveryFlynn, Today, 04:57 AM
                                1 response
                                12 views
                                0 likes
                                Last Post NinjaTrader_Erick  
                                Started by r68cervera, Today, 05:29 AM
                                1 response
                                10 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Working...
                                X