Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy not entering short trades

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

    Strategy not entering short trades

    I have a few strategies that are variations of an idea that I'm working on. I put them together in the Strategy Wizard.

    They will not take a short entry, only longs. I put a line in the strategy to print "short" to the Output window when the short conditions were met, but the short is never taken--even though the message is printed in the Output Window. Only longs are taken.

    I have checked some other strategies that I have that are unrelated to this batch, and they execute both longs and shorts.

    Thanks in advance for any assistance.

    Best,
    a

    #2
    Hello angela d,

    What is the exact code that you have that places the trade?
    (If the script is still in the Wizard mode, click the View code button to view the code and copy the contents of OnBarUpdate)

    Are you using a market order or an order that may not fill immediately such as a limit or stop order?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      EnterShort(DefaultQuantity, "");
      PrintWithTimeStamp("sgort");

      Comment


        #4
        I'm using a market order

        Comment


          #5
          Hello angela d,

          The code you have appears correct.

          May I test your script on my end?

          To export a NinjaTrader 7 NinjaScript do the following:
          1. Click File -> Utilities -> Export NinjaScript
          2. Enter a unique name for the file in the value for 'File name:'
          3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
          4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


          By default your exported file will be in the following location:
          • (My) Documents\NinjaTrader 7\bin\Custom\ExportNinjaScript\<export_file_name.z ip>


          Below is a link to the help guide on Exporting NinjaScripts.
          http://www.ninjatrader.com/support/h...nt7/export.htm


          Once exported, please attach the exported file to your reply.

          (If you would like to keep the script private please let me know and I will direct you to send this to our platform support email)
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            I don't have a clean installation of NT7 from which to export a strategy. Every time I've tried to do so from my trading machine, it attaches every single 3rd party indicator that I have ever installed.

            Comment


              #7
              Hello angela d,

              This should not be the case if you are exporting an open source script.
              (This would happen for any assemblies if you are trying to export your script as an assembly)

              I would like to schedule a call with you to observe this behavior.

              Please send an email to platformsupport [at] ninjatrader [dot] com.
              In the email please include a link to this forum thread.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                I get errors every time I've tried "Export selected source files". If I choose compiled assembly, it grabs everything that is not standard for NT7.

                Comment


                  #9
                  Hello angela d,

                  If you send an assembly I will not be able to review the code and assist.
                  You must export as an open source script so that I may test, review the code, and then assist with corrections.

                  Also, you are correct. If you attempt to export the script as a compiled assembly, the script will reference any 3rd party assemblies that you have imported on your system. However, a compiled assembly would not be helpful for me to assist.

                  However, the error you are getting when exporting as open source is likely because you are calling an indicator in the script and not including this with your export. (Such as the MACD or the Bollinger indicators)

                  Please include the full error message you are seeing in the Log tab of the Control Center when exporting this script.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    I cannot "Export selected source files" WITHOUT GETTING ERRORS. I thought I was clear about this before.

                    "Error compiling export sources. Please check your logs."

                    The log errors refer to third party strategies that are entirely unrelated to these strategies.

                    Comment


                      #11
                      I emailed the errors from the log file, as well as the entirety of the script from the strategy.

                      Comment


                        #12
                        Hello angela d,

                        I understand that when you attempt to export an open source script you are getting errors.

                        I have received the errors via email and these appear to be compile errors.

                        I have sent a reply to ask you to compile to look for those errors, which would let us know there is a compile error.

                        It looks like two scripts are including the same class.

                        As you are still posting in this forum thread, would you like to return to the forum thread, instead of communicating through email?
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          I would prefer to continue via email, since I do not want to post anything about my third party resources on this forum.

                          I replied to your email. I had no compile errors.

                          thank you,
                          a

                          Comment


                            #14
                            Sure wish I could get a reply.

                            Comment


                              #15
                              any chance of a reply?!

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by cre8able, Yesterday, 07:24 PM
                              1 response
                              13 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by cocoescala, 10-12-2018, 11:02 PM
                              6 responses
                              939 views
                              0 likes
                              Last Post Jquiroz1975  
                              Started by gbourque, Today, 06:39 AM
                              1 response
                              4 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by cmtjoancolmenero, Yesterday, 03:58 PM
                              1 response
                              17 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by benmarkal, Yesterday, 12:52 PM
                              3 responses
                              23 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Working...
                              X