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

How to set a stop that moves up after hitting a certain unrealized tick gain

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

    #16
    I didn't have the bars since execution in a group "if any" not sure why that was the hang up but I got it working.

    Comment


      #17
      I figured out it wasn't taking trades due to the bars since exit.

      I guess it needed to be in a group.

      Now I'm getting this error when trying to run it through playback.

      It will make a few trades then once that error pops up no more trades will take place.

      Assuming that's some type of fail switch to not make any more trades after that error.



      Attached Files

      Comment


        #18
        Hello Prestonf,

        In the videos, I am placing the prints in OnBarUpdate() one line above the condition being investigated (and in a blank condition set one set before the condition set being investigated in the Strategy Builder).

        The print includes the time of the bar and all values being compared in the condition being investigated and includes labels for all values and comparison operators.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Thanks I figured out why it wasn’t taking trades but now I’m having that new problem.

          In post NinjaScript File Sharing it will take a few trades then none and if I reload the script all the trades it did take will disappear.

          Comment


            #20
            Post # 18 on here

            Comment


              #21
              Hello Prestonf,

              Sounds like it isn't placing trades in historical.

              Please add the State to the print output and provide the print output text file with your next post so we may assist in analyzing what is causing the behavior.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #22
                How would I Print the BarCountStart, BarCountStop, BarsAfterExit, etc?

                Then that compile problem.





                Attached Files

                Comment


                  #23
                  Hello Prestonf,

                  I'm not sure what BarCountStart BarCountStop, BarsAfterExit are. Are these variables you have declared. Are these integers?

                  Lets focus on that after we have resolved the first issue, and work on one thing at a time.

                  Currently, your inquiry is why is the condition to submit the limit order not evaluating as true.

                  Lets finish debugging this, by printing all of the values in that condition set with the time of the bar.

                  Then we can focus on the next issue of printing your custom variables.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #24
                    Hey Chelsea thanks for your response, I did get the strategy to limit fill short.

                    It was a problem with not having certain conditions in a group.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by dcriador, Today, 12:06 PM
                    0 responses
                    1 view
                    0 likes
                    Last Post dcriador  
                    Started by dcriador, Today, 12:04 PM
                    0 responses
                    0 views
                    0 likes
                    Last Post dcriador  
                    Started by cutzpr, Today, 08:54 AM
                    0 responses
                    6 views
                    0 likes
                    Last Post cutzpr
                    by cutzpr
                     
                    Started by benmarkal, Today, 08:44 AM
                    0 responses
                    12 views
                    0 likes
                    Last Post benmarkal  
                    Started by Tin34, Today, 03:30 AM
                    2 responses
                    26 views
                    0 likes
                    Last Post Tin34
                    by Tin34
                     
                    Working...
                    X