Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

If OnBarUpdate is NEVER called...

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

    If OnBarUpdate is NEVER called...

    Say I'm in a strategy, and it's thinly traded. I enter a position.

    Nothing trades.

    How do I get out with market order say in like 5 minutes since OnBarUpdate would never called?

    No bars are generated if there is no trade, right? (I've seen this before, please correct me if I am wrong).

    I've been thinking about this for a while...

    #2
    Originally posted by sledge View Post
    Say I'm in a strategy, and it's thinly traded. I enter a position.

    Nothing trades.

    How do I get out with market order say in like 5 minutes since OnBarUpdate would never called?

    No bars are generated if there is no trade, right? (I've seen this before, please correct me if I am wrong).

    I've been thinking about this for a while...
    That is why the gurus tell us not to trade thinly traded stocks!

    You just get out and take your lumps. On a thin stock you MUST buy at the ask and you will be forced to sell at the bid, thus giving up the bid/ask spread for the privilege of holding the stock for those 5 minutes. Of course, on a thin stock, the bid/ask spread is a chasm. The market makers are already licking their chops as soon as they see you log on. Oops.

    Comment


      #3
      Good point. I remember a year or so ago, when the Nasdaq Composite index went dead for the last hour of trading.

      It would be nice to have a ninjascript call to handle events not tied to market data.

      Besides OnBarUpdate() method call, there's also...

      OnFundamentalData()
      OnMarketData()
      OnMarketDepth()
      OnStartUp()
      OnTermination()

      I doubt one of those calls would help in your situation.

      Comment


        #4
        Oh, I found something in Ninjascript Library...

        TriggerCustomEvent()

        Comment


          #5
          Originally posted by borland View Post
          Good point. I remember a year or so ago, when the Nasdaq Composite index went dead for the last hour of trading.

          It would be nice to have a ninjascript call to handle events not tied to market data.

          Besides OnBarUpdate() method call, there's also...

          OnFundamentalData()
          OnMarketData()
          OnMarketDepth()
          OnStartUp()
          OnTermination()

          I doubt one of those calls would help in your situation.


          I would also like to see :

          OnConnectionLost()

          This would lead to advanced Handling to Connections... which would allow me to programmatically try to reconnect to connection #1 (zenfire), #2 TDA, determine what connection is bad (both Zenfire or TDA).. is it total internet loss? (then shutdown strategy, etc).. if not, send email to myself.. etc.

          Maybe even programmatic callbacks, like if 5 minutes is up, then call my call back, so it would be an actual 5 minutes... and not related to OnBarUpdate...

          Comment


            #6
            Originally posted by borland View Post
            Oh, I found something in Ninjascript Library...

            TriggerCustomEvent()

            http://ninjatrader.com/support/helpG...ustomevent.htm
            Mmmmmmmmmm... thanks!

            Comment


              #7
              Originally posted by sledge View Post
              I would also like to see :

              OnConnectionLost()

              This would lead to advanced Handling to Connections... which would allow me to programmatically try to reconnect to connection #1 (zenfire), #2 TDA, determine what connection is bad (both Zenfire or TDA).. is it total internet loss? (then shutdown strategy, etc).. if not, send email to myself.. etc.

              Maybe even programmatic callbacks, like if 5 minutes is up, then call my call back, so it would be an actual 5 minutes... and not related to OnBarUpdate...
              It is there! Just that it is called OnConnectionStatus(). To determine if the connection is lost, you want ConnectionStatus.ConnectionLost. Tee hee.

              Comment


                #8
                You can slap me around with a wet fish.


                Originally posted by koganam View Post
                It is there! Just that it is called OnConnectionStatus(). To determine if the connection is lost, you want ConnectionStatus.ConnectionLost. Tee hee.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by DJ888, 04-16-2024, 06:09 PM
                3 responses
                10 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by RookieTrader, Today, 07:41 AM
                0 responses
                2 views
                0 likes
                Last Post RookieTrader  
                Started by maybeimnotrader, Yesterday, 05:46 PM
                1 response
                18 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by Perr0Grande, Yesterday, 08:16 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by f.saeidi, Yesterday, 08:12 AM
                3 responses
                26 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X