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 wuannetraam, Today, 12:22 AM
      0 responses
      4 views
      0 likes
      Last Post wuannetraam  
      Started by TGOG1, Yesterday, 03:02 PM
      2 responses
      20 views
      0 likes
      Last Post TGOG1
      by TGOG1
       
      Started by AlgoDreamer, Yesterday, 06:12 PM
      0 responses
      8 views
      0 likes
      Last Post AlgoDreamer  
      Started by Rafaelseki, Yesterday, 03:36 PM
      0 responses
      8 views
      0 likes
      Last Post Rafaelseki  
      Started by rdlans, Yesterday, 05:42 AM
      2 responses
      25 views
      0 likes
      Last Post rdlans
      by rdlans
       
      Working...
      X