Announcement

Collapse
No announcement yet.

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.

    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.

        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.

            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.

                  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 NullPointStrategies, Today, 05:17 AM
                    0 responses
                    50 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    126 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    69 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    42 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    46 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X