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

manual stop

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

    manual stop

    Click image for larger version

Name:	fsdafadsfasdfasgdgagageffaefaefeafafa.png
Views:	178
Size:	31.0 KB
ID:	1212719

    Will something like this work?
    That if profit from 1 bar ago was greater than $20 and I'm going negative $0 just manually stop out?
    I'm considering something like this because my experience with the ATM is that it doesnt even enable itself.
    My experience with trailing stops has been its too complicated to work.
    My experience in doing what I'm trying to do manually here has been.. its very very unreliable. You dont know if it'll stop out. thanks

    #2
    Hello ezrollin,

    Thanks for your post.

    I would not be able to determine if your strategy would work based on the screenshot you shared.

    Ultimately, you would have to thoroughly test and debug your strategy to determine if the strategy works as you expect it to.

    Below is a link to a forum post that demonstrates how to use prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121

    Note that NinjaScript strategies are intended to run without any manual intervention. NinjaScript strategies cannot see manually placed orders and if you manually place orders then your Strategy Position and Account position will be out of sync.

    See this help guide page for information about Strategy Position vs Account Position: https://ninjatrader.com/support/help..._account_p.htm

    If you would like to place a stop loss, profit target, or trailing stop order, you could consider using the Stops and Targets screen of the Strategy Builder.

    Stops and Targets screen: https://ninjatrader.com/support/help...dTargetsScreen

    Or, you could use Exit methods, such as ExitLongLimit() and ExitLongStopLimit(), to place stop loss and profit target orders. You could see the example scripts in the forum thread linked below for an example of Strategy Builder breakeven and Strategy Builder trailing stop.

    https://ninjatrader.com/support/foru...der#post806596

    Let me know if I may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Click image for larger version

Name:	sadfasdfasfeaceavaeaaadfadsfdas.png
Views:	108
Size:	29.8 KB
ID:	1219405

      I think this is what I meant to show you.
      I'm trying to make an auto break even or a way to protect profits when I'm up a certain amount, I just want to make sure I cant go negative.
      You recommended me to use ExitLongStopLimit() but it never works for me.

      Why does my Condition/Action never work when I do something like this? thanks

      Comment


        #4
        ExitLongStopMarket() is shown in my picture

        Comment


          #5
          Hello ezrollin,

          The order would be automatically cancelled if it is not submitted on each new bar.

          Enable TraceOrders and add prints to understand what is happening with your script.


          Below is a link to an example of a breakeven and trailing logic with exit orders in the Strategy Builder.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            with the way this condition is written in the screenshot, isnt it already set up to be submitted each new bar/price change/tick?

            Comment


              #7
              Hello ezrollin,

              Thanks for your note.

              The order in the screenshot you shared in post # 3 would submit the Exit order when the conditions you set become true.

              If the expected trade(s) are not appearing, this would indicate that the condition to place the order is not evaluating as true or the order is being ignored for other reasons.

              To understand why the script is behaving as it is, such as placing orders or not placing orders when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

              In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

              Also, enable TraceOrders which will let us know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

              Below is a link to a forum post that demonstrates how to use prints to understand behavior.

              https://ninjatrader.com/support/foru...121#post791121

              Let me know if I may assist further.​
              Brandon H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rhyminkevin, Today, 04:58 PM
              1 response
              41 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
              49 views
              0 likes
              Last Post futtrader  
              Working...
              X