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 rhyminkevin, Today, 04:58 PM
                    3 responses
                    48 views
                    0 likes
                    Last Post Anfedport  
                    Started by iceman2018, Today, 05:07 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post iceman2018  
                    Started by lightsun47, Today, 03:51 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post lightsun47  
                    Started by 00nevest, Today, 02:27 PM
                    1 response
                    14 views
                    0 likes
                    Last Post 00nevest  
                    Started by futtrader, 04-21-2024, 01:50 AM
                    4 responses
                    50 views
                    0 likes
                    Last Post futtrader  
                    Working...
                    X