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

Strategy Builder help

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

    Strategy Builder help

    Hello NT community,

    I need help with a simple ninjascript. The indicator I'm using is from a vendor(bgglobal). The indicator calculates On bar close. How would I code in Strategy Builder...go long when a bullish blue bar shows up and exit on a bearish red bar when it shows up. I have attached photos of the indicators plots and what the supposed strategy would do. All help will be appreciated.

    Thank you
    Titli
    Attached Files

    #2
    Hello Titli,

    Thank you for your post.

    Looks like this indicator plots a 1 to either the bearish, bullish or neutral plots depending on which is the case for that particular bar. So you'd want to have one condition set where the condition compares the indicator on the left with a bars ago setting of 0 and the plot set to bullish and compare that with Equals and on the right choose Misc > Numeric Value of 1. In the actions for that set, Order Management > Enter Long.

    To exit on a bearish bar, create another condition set where in the condition you have the indicator on the left with a bars ago of 0 and the plot set to bearish, and compare that with Equals to Misc > Numeric value of 1. In the actions for that set, use Order Management > Exit Long.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_Kate,

      I did as you said but it did not compile.
      Attached Files

      Comment


        #4
        Hello Titli,

        Thank you for your reply.

        What is the error generated? Is it generated when you try to add the condition or when you try to compile?

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          error creating strategy "could not compile ninjascript"

          Comment


            #6
            Hello Titli,

            Thank you for your reply.

            If you open a NinjaScript Editor window (New > NinjaScript Editor) and then hit the compile button in the Strategy Builder, it should show the full compile error that's occurring in the NinjaScript Editor in orange. Can you supply a screenshot of the errors if any that appear in this window?
            • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
            • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.
            Thanks in advance; I look forward to assisting you further.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              It isn't showing up in the NinjaScript Editor after trying to compile it. It is not in the strategies tab.

              Comment


                #8
                I have NT version 8.0.25.0

                Comment


                  #9
                  Hello Titli,

                  Thank you for your replies.

                  Do you see any errors in regards to the strategy in the Log tab of the Control Center? If so, what is the full text of the error?

                  If no error is seen or its the same as you mentioned previously, unfortunately, our ability to troubleshoot the use of third party scripts in the Strategy Builder is hampered by the fact these are generally distributed as compiled assemblies, meaning we cannot view the code nor do we have it available for testing. I would recommend reaching out to the vendor for assistance with setting up strategy conditions based on their indicator.

                  Please let us know if we may be of further assistance to you.
                  Kate W.NinjaTrader Customer Service

                  Comment


                    #10
                    Unfortunately, there are no problems in the log tab as well. Thank you for all your help Kate.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by SantoshXX, Today, 03:09 AM
                    0 responses
                    6 views
                    0 likes
                    Last Post SantoshXX  
                    Started by DanielTynera, Today, 01:14 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post DanielTynera  
                    Started by yertle, 04-18-2024, 08:38 AM
                    9 responses
                    41 views
                    0 likes
                    Last Post yertle
                    by yertle
                     
                    Started by techgetgame, Yesterday, 11:42 PM
                    0 responses
                    12 views
                    0 likes
                    Last Post techgetgame  
                    Started by sephichapdson, Yesterday, 11:36 PM
                    0 responses
                    2 views
                    0 likes
                    Last Post sephichapdson  
                    Working...
                    X