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

Strategy Builder Condition -prevent executing when price goes in opposite direction

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

    Strategy Builder Condition -prevent executing when price goes in opposite direction

    This is what I am trying to prevent.

    WrongDirectionSameCandle

    I have what I think is a good strategy. The only place it fails is when the price reverses in the same candle like in the image above.
    I am writing this condition but it is being ignored. I am sure I am not writing it correctly.

    WithinTheSameBar
    Would very much appreciate someone correcting me. For a sell, in the same bar, I want to write the price going down for a condition. Seems simple enough, and yet my brain is not working this morning.

    Thank you in advance
    Chris​

    #2
    Hello, thanks for writing in. One thing to note about using the Ask price is that, underneath, it uses GetCurrentAsk() to get this value, which returns the Close[0] price in the historical state. Only in real time, it will give you the actual Ask price. Another good way to solve bugs in custom strategies is to use the Misc>Print action in your actions list. This can print out the data your strategy is using so you can see why your conditions are triggering despite what you think you have set up in the conditions list.

    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chris!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by LawrenHom, Today, 10:45 PM
      0 responses
      3 views
      0 likes
      Last Post LawrenHom  
      Started by love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      7 views
      0 likes
      Last Post funk10101  
      Started by pkefal, 04-11-2024, 07:39 AM
      11 responses
      37 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Yesterday, 08:51 AM
      8 responses
      44 views
      0 likes
      Last Post bill2023  
      Working...
      X