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 StockTrader88, 03-06-2021, 08:58 AM
              45 responses
              3,992 views
              3 likes
              Last Post johntraderuser2  
              Started by TAJTrades, Today, 09:46 AM
              0 responses
              7 views
              0 likes
              Last Post TAJTrades  
              Started by rhyminkevin, Yesterday, 04:58 PM
              5 responses
              62 views
              0 likes
              Last Post dp8282
              by dp8282
               
              Started by realblubb, Today, 09:28 AM
              0 responses
              8 views
              0 likes
              Last Post realblubb  
              Started by AaronKoRn, Yesterday, 09:49 PM
              1 response
              19 views
              0 likes
              Last Post Rikazkhan007  
              Working...
              X