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.

    https://ninjatrader.com/support/help...script_cod.htm
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chris!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Douglee, Today, 01:34 PM
      0 responses
      1 view
      0 likes
      Last Post Douglee
      by Douglee
       
      Started by pjsmith, 10-28-2021, 03:01 AM
      8 responses
      80 views
      0 likes
      Last Post WalterSkinner  
      Started by sjmuk1, Today, 10:18 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by alanack, Today, 09:33 AM
      4 responses
      32 views
      0 likes
      Last Post alanack
      by alanack
       
      Started by Skechers, Today, 11:37 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Working...
      X