Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Question on GetCurrentBid() functionality

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

    Question on GetCurrentBid() functionality

    In the help file, there is a note regarding the GetCurrent Bid() method, which states “When accessed during a historical backtest, the close price of the evaluated bar is substituted.” This suggests that one could easily get skewed results when using this programatically.

    I'm hoping that some forum members may have used GetCurrent Bid() and can answer the following questions.

    Question 1: If I had a one minute chart open, would this essentially mean that only the last bid of the minute would be accessed by Ninja?

    Question 2: Is the bid data actually stored by Ninja, or is it just retrieved from a datafeed?

    Question 3: Can bid data be accessed when there is no live data connection? For instance, let's say I was connected to a datafeed for an entire trading day, but then went offline at 4PM. Would the bid data collected throughout the day remain available in Ninja?

    Question 4: Would it be plausible to store GetCurrentBid() data to a DataSeries? If I were to exit Ninja, would that have the effect of emptying all values stored in such a DataSeries … and therefore result in substitution of close values (when Ninja was next started)?

    #2
    Hello h1000,

    Thank you for your post.
    1. Correct, GetCurrentBid() would only pull the current bid price.
    2. The Bid data is stored by NinjaTrader after being pulled from the data feed provider. You can find information on accessing historical bid and ask prices in your code at the following link: http://www.ninjatrader.com/support/h..._ask_serie.htm
    3. You can access historical Bid and Ask prices when not connected to a data feed provider.
    4. If you wish to store values please refer to the following reference sample for information: http://www.ninjatrader.com/support/f...ead.php?t=7299

    Please let me know if you have any questions.

    Comment


      #3
      Hello h1000,

      I would like to clarify on the answers to your questions further.

      2. Bid data would not be stored unless you had created a Data Series on your chart set for Price Based On to Bid (right click in your chart > select Data Series > Price Based On). When using your indicator offline the close price will be returned for the GetCurrentBid() method.

      4. If using GetCurrentBid() the values would be cleared on exit of NinjaTrader, therefore it would not repopulate the Bid price historically but once again GetCurrentBid() would return the close price on historical data. You may wish to look into the GOMI framework for storing data in binary files on your PC for use later for historical data. You can find a thread on the GOMI recorders at the following link: http://www.ninjatrader.com/support/f...highlight=GOMI

      Please let me know if I may be of further assistance.

      Comment


        #4
        Patrick,

        Thanks for the quick reply!

        If using GetCurrentBid() the values would be cleared on exit of NinjaTrader, therefore it would not repopulate the Bid price historically but once again GetCurrentBid() would return the close price on historical data.
        I had suspected that this might be be a problem. I will look into a GOMI solution and see where it leads.

        Meanwhile, if anyone else has any suggestions (particularly in relation to GOMI) please post; I would be most grateful for feedback/info.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        44 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        180 views
        0 likes
        Last Post jeronymite  
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Working...
        X