Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

true at moment of time

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

    true at moment of time

    Hello,

    I need for a "semi-auto" script strategy a condition that is true at "this" moment of time (or true always). With GetCurrentAsk>GetCurrentBid I experience some issue. No matter why, I think there must be anything else to get an immediate entry by a "now-true-condition"

    Thank you
    Tony

    #2
    Hi Tony, the issue probably is that you try to enter in the OnBarUpdate(), this would be tied to receiving an tick update, so even if the condition is true > you would need to see a trade taking place before it's triggered even in realtime with CalculateOnBarClose = false.

    Comment


      #3
      Hello,

      thank you for your reply. And what does this mean now? I understand what I have done wrong. But not what I should do? (the conditions I have in onbarupdate)

      Thank you for your support.

      Best regards
      Tony


      Originally posted by NinjaTrader_Bertrand View Post
      Hi Tony, the issue probably is that you try to enter in the OnBarUpdate(), this would be tied to receiving an tick update, so even if the condition is true > you would need to see a trade taking place before it's triggered even in realtime with CalculateOnBarClose = false.

      Comment


        #4
        Tony, the OnBarUpdate() would be limited to the update timing explained. You would need to work out of this context then for the 'now' moment, i.e. a timer that would for example be guaranteed to trigger every second. Here's an example that would introduce such a technique - http://www.ninjatrader.com/support/f...ead.php?t=5965

        Another item you could look into would be for example the OnMarketData method, here you could get an event raised for any Level 1 data change, which might be closer to what you seek than waiting on OnBarUpdate() to fire.

        Comment


          #5
          Hello Bertrand,

          thank you for your reply. How can I work with the condition in onmarketdata and the other conditions in onbarupdate so that there is an entry when both are true?

          Thank you
          Tony

          Originally posted by NinjaTrader_Bertrand View Post
          Tony, the OnBarUpdate() would be limited to the update timing explained. You would need to work out of this context then for the 'now' moment, i.e. a timer that would for example be guaranteed to trigger every second. Here's an example that would introduce such a technique - http://www.ninjatrader.com/support/f...ead.php?t=5965

          Another item you could look into would be for example the OnMarketData method, here you could get an event raised for any Level 1 data change, which might be closer to what you seek than waiting on OnBarUpdate() to fire.

          Comment


            #6
            Tony, you would for example set a bool in OnBarUpdate() when it's ready and then check off that bool in OnMarketData when an event is fired.

            Comment


              #7
              Thank you!

              Originally posted by NinjaTrader_Bertrand View Post
              Tony, you would for example set a bool in OnBarUpdate() when it's ready and then check off that bool in OnMarketData when an event is fired.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              80 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              46 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              29 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              32 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              66 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X