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

Break-Even Stop Placed Lower Than Intended in RTY 5 Renko Chart with NinjaScript Bot

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

    Break-Even Stop Placed Lower Than Intended in RTY 5 Renko Chart with NinjaScript Bot

    Hello everyone,

    I hope you're all having a great day. I'm reaching out for assistance regarding an issue I've been facing with my NinjaTrader bot, specifically related to implementing a breakeven stop.

    Following the example provided in the NinjaTrader forum (you can find the link here: Breakeven on Strategy Builder), I attempted to incorporate a breakeven stop into my strategy. However, I've encountered a significant drawback: the stops are consistently placed above the market, resulting in my bot being disabled due to stop rejection errors.

    After carefully reviewing my code and comparing it with the provided example, I still can't identify the reason behind this undesired behavior. I would greatly appreciate any guidance, suggestions, or corrections you can offer to resolve this issue.

    It's worth noting that I'm relatively new to NinjaScript programming, so any insights from the community, especially if you've experienced something similar or have ideas on addressing this specific problem with breakeven stops in NinjaTrader, would be incredibly valuable.

    Thank you all in advance for your time and assistance.

    Best regards,

    Drackstack.

    Attached to this post is a link to download the code for the bot I've been developing.
    Attached Files
    Last edited by drackstack; 12-10-2023, 05:08 PM.

    #2
    I have made a mistake with the subject; It should be 'Issue with Breakeven Stop in NinjaTrader Strategy Builder - Seeking Help from the Community' instead of 'Break-Even Stop Placed Lower Than Intended in RTY 5 Renko Chart with NinjaScript Bot.

    Comment


      #3
      Hello drackstack,

      I took a look at the code however this appears to be a manually coded strategy. With that in mind it would be easier to use a manually coded example that has a breakeven already in its logic. The following sample demonstrates how to do that by watching for the entry order fill and then saving that order to a variable so the average price is known. Then a condition is made for a breakeven.



      If you wanted to keep using the strategy you attached you can use Print statements to verify that your conditions are working as you expect and also what prices are being generated when those conditions are true. That would let you see how the strategy is logically working to know why it may be placing orders on the wrong side of the market.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pibrew, Today, 06:10 PM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by actualfacts.2021, 07-25-2021, 03:11 PM
      8 responses
      1,182 views
      0 likes
      Last Post linkcou
      by linkcou
       
      Started by reynoldsn, Today, 07:11 PM
      0 responses
      3 views
      0 likes
      Last Post reynoldsn  
      Started by needsomehelp147, 04-29-2024, 06:43 AM
      2 responses
      19 views
      0 likes
      Last Post needsomehelp147  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      177 responses
      2,400 views
      0 likes
      Last Post jeronymite  
      Working...
      X