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

Stop & target Submission

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

    Stop & target Submission

    Hi,

    I have developed this easy code (you can watch it on the code file).

    The problem is that if I run this strategy in real time I can't change the option "Stop & Target Submission" in Order Handling (as you can see on the sencond screenshot). I always have ByStrategyPosition, but I need PerEntryExecution.

    Is there something wrong with the code? What do I need in order to change that set up?

    Thank you in advance.
    Attached Files
    Last edited by Plaket; 10-21-2014, 08:18 AM.

    #2
    Hi Plaket,

    Have you tried setting this before enabling the script?

    Once enabled, a scripts parameters cannot be changed.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the answer Chelsea,

      Yes of course I did it.

      The point here is that, I can turn it from ByStrategyPosition to PerEntryExecution before to enable. But it doesn't work. As soon as I enable the strategy this point turn again ByStrategyPosition.

      Comment


        #4
        Hi Plaket,

        Does this behavior also happen with the SampleMACrossOver script as well?

        Did you create this script or was this script imported?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          No, this behavior is not happening with the SampleMACrossOver. Just with this code, but as you can see is a very simple code, for that reason I can't udnerstand the reason of it. I developed the script.

          Is there anything I can change in order to solve it?

          The point is that I have a hard code showing the same problem, for that reason I did a easier code to show you the problem. I am sure that If I programm this simple code again I am not going to have this problem, but I would like to find the mistake in order to correct the other long script /hard code.

          Thank you in advance.

          Comment


            #6
            Hi Plaket,

            May I test this code on my end?

            To export your script 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.zip>


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


            Please attach the export to your next post (or if you would like to keep the script private let me know and I will have you email it to support).
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Of course Chelsea,

              Here it is.

              Thank you in advance.
              Attached Files

              Comment


                #8
                Hi Plaket,

                Thank you for the script.

                I was not able to reproduce this behavior.

                Below is a link to a video of my attempt to reproduce this.
                http://screencast.com/t/S2WXOgEL

                I'd like to schedule a call with you to investigate this on your end. Please send an email to platformsupport [at] ninjatrader [dot] com. In the email, please add a link to this forum thread.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  You are so kind Chelsea.

                  Thank you for the video. The point is that I don't have problems with this set up. I can set up ByStrategyPoistion correctly without problems. I have problems when I try to turn it to PerEntryExecution. please, could you check if you are able to turn it to PerEntryExecution? I need this last one option.

                  Thank you in advance.
                  Last edited by Plaket; 10-21-2014, 10:11 AM.

                  Comment


                    #10
                    Hello Plaket,

                    The issue here is that you are calling SetStopLoss with the Currency overload. When this is used, the StopLoss will be for the entire position.
                    Because of this, the stop and target cannot be set per entry.

                    Instead, you would want to use a CalculationMode in your overload parameter so that the stop loss will be for individual entries instead of the entire position.
                    http://www.ninjatrader.com/support/h...etstoploss.htm
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Thank you!

                      All is clear now.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Jon17, Today, 04:33 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post Jon17
                      by Jon17
                       
                      Started by Javierw.ok, Today, 04:12 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post Javierw.ok  
                      Started by timmbbo, Today, 08:59 AM
                      2 responses
                      10 views
                      0 likes
                      Last Post bltdavid  
                      Started by alifarahani, Today, 09:40 AM
                      6 responses
                      41 views
                      0 likes
                      Last Post alifarahani  
                      Started by Waxavi, Today, 02:10 AM
                      1 response
                      21 views
                      0 likes
                      Last Post NinjaTrader_LuisH  
                      Working...
                      X