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 Rapine Heihei, 04-23-2024, 07:51 PM
                2 responses
                30 views
                0 likes
                Last Post Max238
                by Max238
                 
                Started by Shansen, 08-30-2019, 10:18 PM
                24 responses
                943 views
                0 likes
                Last Post spwizard  
                Started by Max238, Today, 01:28 AM
                0 responses
                9 views
                0 likes
                Last Post Max238
                by Max238
                 
                Started by rocketman7, Today, 01:00 AM
                0 responses
                4 views
                0 likes
                Last Post rocketman7  
                Started by wzgy0920, 04-20-2024, 06:09 PM
                2 responses
                28 views
                0 likes
                Last Post wzgy0920  
                Working...
                X