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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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.
            BertrandNinjaTrader Customer Service

            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 marcus2300, Yesterday, 10:21 AM
              6 responses
              20 views
              0 likes
              Last Post marcus2300  
              Started by skorpn, Today, 01:28 AM
              0 responses
              9 views
              0 likes
              Last Post skorpn
              by skorpn
               
              Started by ETFVoyageur, Today, 12:52 AM
              0 responses
              6 views
              0 likes
              Last Post ETFVoyageur  
              Started by Board game geek, Yesterday, 02:20 AM
              2 responses
              23 views
              0 likes
              Last Post Board game geek  
              Started by jackiegils, Yesterday, 11:05 PM
              0 responses
              7 views
              0 likes
              Last Post jackiegils  
              Working...
              X